Tuesday, April 20, 2021

Remove Number sequence in Parameter form in D365Fo using X++

 

 Remove Number sequence in Parameter form in D365Fo using X++.


public static void main(Args _args)

    {

       NumberSequenceDatatype numSeqDT; // EDT information

        NumberSequenceReference numSeqRef; // Merging relation between EDT and number sequence

        select forUpdate numSeqDT

        where numSeqDT.DatatypeId == extendedtypenum(BookingID); // EDT Id

        delete_from numSeqRef

        where numSeqRef.NumberSequenceDatatype == numSeqDT.RecId;

        ttsBegin;

        numSeqDT.delete();

        ttsCommit;

        info( strFmt("Relation with EDT: %1 is removed.", numSeqDT.DatatypeId) );

    }

Keep Daxing!!

No comments:

Post a Comment