Posts

Showing posts from November, 2018

AX 2012 R3 Line by line invoicing the sales order using X++ code

AX 2012 R3 Line by line invoicing the sales order using X++ code static void RB_PostSalesInvoice(Args _args) {     SalesTable salesTable;     SalesFormLetter salesFormLetter;     Query query;     QueryRun queryRun;     QueryBuildDataSource qbds;     salesTable = SalesTable::find('20001');     query = new Query(QueryStr(SalesUpdatePackingSlip));     qbds = query.dataSourceTable(tableNum(SalesLine));     // Build query range to find those lines which needs to be posted.     qbds.addRange(fieldNum(SalesLine, SalesId)).value('20001');     qbds.addRange(fieldNum(SalesLine, SalesStatus)).value(queryValue(SalesStatus::Backorder));     qbds.addRange(fieldNum(SalesLine, itemId)).value('V12_IF');     queryRun = new queryRun(query);     salesFormLetter = SalesFormLetter::construct(DocumentStatus::Invoice);     salesFormLetter.chooseLinesQue...

History maintaining by createdby/modifiedby in history table

History maintaining by createdby/modifiedby in history table: // + My Comment (Added by incadmin - INC-vinod - Start 24/10/2018) void clicked() {     INC_DeliveryDateHistory history;     super();     select history where history.SalesId ==  SalesTable.SalesId;     if(!history)     {         history.SalesId = SalesTable.SalesId;         history.INC_DeliveryDate = SalesTable.INC_DeliveryDate;         history.INC_CreatedBy = curUserId();         history.INC_CreatedDateTime = DateTimeUtil::utcNow();         history.insert();         info("Delivery date is confirmed.");     }     else     {         history.SalesId = SalesTable.SalesId;         history.INC_DeliveryDate = SalesTable.INC_DeliveryDate;         h...

Creating a numbersequence in form level in ax 2012

Image
Creating a numbersequence in form level in ax 2012: Overview Number sequences are unique identifiers that can be associated with a master record so that they can be individually distinguished. They can be either formatted as alpha-numeric strings or simply as numbers. Microsoft Dynamics AX 2012 provides an easy to implement framework to generate custom number sequences. Scenario As part of this tutorial, a custom number sequence will be generated for the Customer Groups setup form ( Accounts receivable  à  Setup  à  Customers  à  Customer groups ) Steps First create a new  Extended Data Type (EDT) . Open  AOT  à Data Dictionary  à  Extended Data Types Right Click on  Extended Data Types  and create a new EDT  NumSeqDemoCustGroupNum  of type  String Set the properties as shown below Now go to  AOT  à  Classes  and open the  NumberSeqModuleCustomer  clas...