Skip to main content

Posts

X++ code to create FreeText Invoice and post in Ax 2012

 First insert in header table like this.         custInvoiceTable.clear();         custInvoiceTable.initFromCustTable(custtable);                 custInvoiceTable.insert(); Then Insert in invoice line table. custInvoiceLine.clear();             custInvoiceLine.initValue();                          //setup main account as required              offsetDimensions = ["3434","3434", 0, "", ""]; // you can set a Main Account with multiple financial dimensions             custInvoiceLine.LedgerDimension = AxdDimensionUtil::getLedgerAccountId(offsetDimensions);             custInvoiceLine.initFromCustInvoiceTable(custInvoiceTable);             custInvoiceLine.ItemId = "erw234324"; //custom field                              custInvoiceLine.Quantity = custinvoicetrans.Qty;             custInvoiceLine.UnitPrice = 1210 ;             custInvoiceLine.modifiedField(fieldNum(CustInvoiceLine, UnitPrice));             custInvoiceLine.Description = custin