Monday, February 27, 2023

Number sequence generate from X++ | D365 F&0 | Dynamics 365 Finance and Operation | Code

 

public static AD_PaymentRemittanceId generateRemittanceId(NumberSequenceCode _numCode)

    {

        NumberSeq               num;

        string                  numSeqCode;

 

        if(!_numCode)

            throw error('Number sequence has not been configured');

 

        num             = numberSeq::newGetNumFromId(NumberSequenceTable::findByNaturalKey(_numCode).RecId);

        numSeqCode     = num.num();

        num.used();

 

        return numSeqCode;

    }

No comments: