Posts

Getting Workflow Approvers In Dynamics AX (AX 2012)

Getting Workflow Approvers In Dynamics AX (AX 2012) Posted by  kamaukihonge  on  June 27, 2014 Posted in:  Development ,  Workflows . Leave a comment UNDERSTANDING THE LOGIC ABOUT WORKFLOW APPROVALS To start with, you need to understand how the workflow approvals are processed in Dynamics AX. There are three tables that we will use WorkflowTrackingStatusTable WorkflowTrackingTable WorkflowTrackingCommentTable This three tables can be used to get the approvers names, Approval Dates and Approval Comment, HOW THE TABLES RELATE TO EACH OTHER WorkflowTrackingStatusTable relates to using the field WorkflowTrackingStatusTable in WorkflowTrackingTable and RecId in WorkflowTrackingStatusTable Simple X++ select Statement WorkflowTrackingStatusTable _status; WorkflowTrackingTable _tracking; select  *  from  _tracking  where  _tracking.WorkflowTrackingStatusTable ==  _status.RecId ; WorkflowTr...

Create custom workflow Microsoft Dynamics AX 2012

Image
Create custom workflow Microsoft Dynamics AX 2012 workflow Here we work on how to create custom workflow using x++  dynamics ax 2012 . It’s simple and easy to do with the following steps in dynamics ax 2012. The following steps shows to create custom workflow for new created customer approval. Below are the objects needs to be created: Base Enum WorkflowApprovalStatus field Method on CustTable Query Workflow category Workflow type Workflow approval Drag workflow approval to workflow type Enable workflow on form BaseEnum: Create “ CustWFApprovalStatus ” base enum for the workflow approval status Not Submitted Submitted Pending Approval Change Request Approved Reject Create new Field on CustTable: Create Enum type field ‘ WorkflowApprovalStatus ‘ on CustTable and assign CustWFApprovalStatus to enumtype Override Method on CustTable: Override canSubmitToWorkflow method on C ustTable pub...

Jumpref in formlevel

Jumpref in formlevel: public void jumpRef() {     Args args = new Args();     PriceDiscAdmTrans priceDiscAdmTransloc;     args.caller(this);      select firstonly priceDiscAdmTransloc         where priceDiscAdmTransloc.JournalNum   == INC_Pricecontract.Journalnum;     args.record(priceDiscAdmTransloc);     new MenuFunction(menuitemdisplaystr(PriceDiscAdm), MenuItemType::Display).run(args); }

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...