Skip to main content

Set up a new number sequence (e.g. for Blanket Orders)

New Data Type



  1. Add a new SalesParameters method:

    static client server NumberSequenceReference numRefSalesIdBlanket()

    {

    return NumberSeqReference::findReference(typeId2ExtendedTypeId(typeid(SalesIdBlanket)));

    }

  2. Assign SalesId in the somewhere during the creation of the blanket order:

    salesTable.SalesId = NumberSeq::newGetNum(SalesParameters::numRefSalesIdBlanket()).num();

  3. Add new reference to NumberSeqReference_SalesOrder class (used to add the new number sequence to the list in the CustParameters form)

    protected void loadModule(){ NumberSequenceReference numRef; ;//blanket order number sequence numRef.DataTypeId = typeId2ExtendedTypeId(typeid(SalesIdBlanket)); numRef.ReferenceHelp = literalstr("@SYS53960"); numRef.ReferenceLabel = literalstr("@CUS525"); numRef.WizardManual = NoYes::No; numRef.WizardAllowChangeDown = NoYes::No; numRef.WizardAllowChangeUp = NoYes::No; numRef.SortField = 1; this.create(numRef);

    }

  4. Set up the new number sequence in the customer parameters form.

Done.

Popular posts from this blog

Dynamics Axapta: Sales Orders & Business Connector

Well, again folllowing my same idea of writting close to nothing and pasting code, I'll paste in some code to create a sales order from some basic data and the invoice it. I'll try to explain more in the future. AxaptaObject axSalesTable = ax.CreateAxaptaObject("AxSalesTable"); AxaptaRecord rcInventDim = ax.CreateAxaptaRecord("InventDim"); AxaptaRecord rcCustTable = ax.CreateAxaptaRecord("CustTable"); rcCustTable.ExecuteStmt("select * from %1 where %1.AccountNum == '" + MySalesOrderObject.CustAccount + "'"); if (MySalesOrderObject.CurrencyCode.Trim().Length == 0) MySalesOrderObject.CurrencyCode = rcCustTable.get_Field("Currency").ToString().Trim(); string sTaxGroup = rcCustTable.get_Field("taxgroup").ToString().Trim(); //set header level fields axSalesTable.Call("parmSalesName", MySalesOrderObject.SalesName.Trim()); axSalesTable.Call("parmCustAccount", M

Passing values between form and class

Class name is EmplDuplication and Form is EmplTable . void clicked() {    MenuFunction mf;    args args = new Args();    ;     args.record(EmplTable);     mf = new menufunction(identifierstr(EmplDuplication), MenuItemType::Action); mf.run(args); } Meanwhile, in the main() method of the EmplDuplication class, we need to put this Axapta x++ code to get the datasource: static void main(Args args) {     EmplDuplication EmplDuplication; EmplTable localEmplTable; ;     if(args.record().TableId == tablenum(EmplTable)) localEmplTable = args.record();     ... }