AX2012 Create FreeTextinvoice from X++: Use different number sequence

My requirement is to use different Number sequence while creating Freetextinvoices from X++ code. Anyone know how to mention to use particular NumberSequence while creating from X++ code.

i am using code similar to…/156


Which number sequence you are talking about?

When the freetextinvoice is posted from number sequence mentioned in AR parameters, invoiceID is assigned. i am creating freetextinvoice from X++ code, i want to generate different InvoiceID(may be from different Number sequence).

Number Sequence is assigned in CustPostInvoice. You customize this class to make a conditional number sequence assignment.

The number sequence group is meant for similar purpose.

Sorry Kranthi, i didn’t get you.

i want the system to use a number sequence from AR parameters while posting freetextinvoice from the UI.

and i want to use different Number sequence to be assigned while creating from X++ Code. Can i achieve this without touching the CustPostInvoice class? thanks for the reply.

Can i achieve by not modifying the CustPostInvoice class? thanks for the reply

The number sequence group on Free text invoice overrides the number sequences given on parameters. You can create the number sequence group and use that group while the free text invoice is created using code.

I’m not seeing other way. You want a conditional number assignment based on the calling object.