The below code is to manually generate the number from the Number Sequence code:
numberSeq = NumberSeq::newGetNumFromCode(BankAccountTable::findByLedgerDimension(this.OffsetLedgerDimension).FundsTransferRefNum);
Sometimes we face this situation where number sequence doesn't release the unused numbers even if the Number sequence is configured as "Continuous". In that case we can use the below code:
NumberSeq::releaseNumber(NumberSequenceTable::findByNaturalKey(BankAccountTable::findByLedgerDimension(this.OffsetLedgerDimension).FundsTransferRefNum).RecId, ledgerJournalTrans_FundsTransfer.FundsTransferRefNum);
numberSeq = NumberSeq::newGetNumFromCode(BankAccountTable::findByLedgerDimension(this.OffsetLedgerDimension).FundsTransferRefNum);
Sometimes we face this situation where number sequence doesn't release the unused numbers even if the Number sequence is configured as "Continuous". In that case we can use the below code:
NumberSeq::releaseNumber(NumberSequenceTable::findByNaturalKey(BankAccountTable::findByLedgerDimension(this.OffsetLedgerDimension).FundsTransferRefNum).RecId, ledgerJournalTrans_FundsTransfer.FundsTransferRefNum);