Category Archives: Dynamics AX

Set up excise taxes in Dynamics AX

In regard to implementing Excise tax in Saudi Arabia, I would like to share the link below to all companies have been implemented Dynamics AX 2012

Common prefixes in Microsoft Dynamics AX


Prefix Description
As Microsoft Dynamics AX typed data source
Axd Microsoft Dynamics AX business document
Asset Asset Asset management
BOM Bill of material
COS Cost accounting
Cust Customer Customer
Dir Directory, global address
EcoRes Economic resources
Human resources Human resources
Invent Inventory management
JMG Shop floor control
KM knowledge management
Ledger General Ledger
PBA Product builder
Prod Production
Proj Project
Purch Purchase
Req Requirements
Sales Sales
SMA Service management
SMM Sales and marketing management also called customer relationship management (CRM)
Sys Application frameworks and development tools
Tax Tax engine
Vend Vendor
Web Web framework
WMS Warehouse management

Walkthrough: Creating a Workflow Template AX 2009

In Microsoft Dynamics AX, you define a workflow by creating a template to base the workflow on. In this walkthrough, you will create a workflow template in the Application Object Tree (AOT) that you can add approvals and tasks to.

A workflow template defines information about:

  • Which workflow document to use. The workflow document exposes calculated fields and identifies the query that exposes data fields for the workflow.
  • Tasks and approvals that can be configured by the end user.
  • Workflow categories used for assigning a workflow template to a specific module.
  • Menu items and event handlers.

This walkthrough illustrates the following tasks:

  • Create a workflow template in the AOT.
  • Create a query to expose data for conditions.
  • Create a workflow document class to identify the query and calculated fields.
  • Bind the query to the workflow document class.
  • Bind the workflow document class to the workflow template.
  • Create a workflow category.
  • Bind the workflow category to the workflow template.
  • Create a SubmitToWorkflow menu item.
  • Bind the workflow menu item to the workflow template.
  • Set a license configuration key for the workflow template.



To complete this walkthrough, you will need:

  • Microsoft Dynamics AX
  • A license file that has access to the MorphX development environment
To create a workflow template in the AOT
  1. In the AOT, expand the Workflow node.
  2. Right-click the Workflow Templates node, and then select New Workflow Template. A workflow template group displays under the Workflow Template node.
  3. Right-click the new workflow template and then click Properties.
  4. In the Properties sheet, set the Name property to MyWorkflowTemplate.
  5. In the AOT, right-click MyWorkflowTemplate, and then click Save.

After the workflow template is created, you can create the objects that you need to bind to the workflow template. For this walkthrough, the next step is to create a query to identify the table data fields used for the workflow document.

To complete Article click here

How to Reverse a PO Invoice in Dynamics AX

You have to create a debit note from your purchase order that will be settled against your PO invoice to essentially cancel that balance on the vendor profile.

To process the debit note,

1- Add a new line on your PO with a negative quantity.

2- Confirm.

3- Post invoice.

You will need to go on the vendor profile to settle the original invoice with the new debit note so that balance will be gone from the vendor profile.

How to post PO by Code in Dynamics AX

I have task to integrate Dynamics AX with another application by posting PO from out side Dynamics AX, so I used AIF and build new web service to be used from out of AX and call the method below to post PO (packing slip, or invoice) .

public str CreatePostProductReceipt(PurchId _PurchId, Num _PackingSlip, ItemId  Itemid, Qty qty,
InventSiteId  InventSiteId =”, InventLocationId  InventLocationId= ” , inventBatchid batchid = ”, InventSerialId  serialId = ”, inventsizeId inventsizeId =”, InventColorId InventColorId =”)
PurchFormLetter             purchFormLetter;
PurchParmUpdate             purchParmUpdate;
PurchParmTable              purchParmTable;
PurchParmLine               purchParmLine;
PurchTable                  purchTable;
PurchLine                   purchLine;
PurchId                     purchId;
Num                         packingSlipId;
InventDim                   inventDim;
str                 ret=”;
System.Exception    err;

packingSlipId   = _PackingSlip;
purchTable      = PurchTable::find(_PurchId);

// Create PurchParamUpdate table
purchFormletter = PurchFormLetter::construct(DocumentStatus::PackingSlip); // to post invoice change to DocumentStatus::invoice


purchParmUpdate = PurchFormLetter.purchParmUpdate();

// Set PurchParmTable table
purchParmTable.TransDate                = SystemDateGet();
purchParmTable.Ordering                 = DocumentStatus::PackingSlip;
purchParmTable.ParmJobStatus            = ParmJobStatus::Waiting;
purchParmTable.Num                      = packingSlipId;
purchParmTable.PurchId                  = purchTable.PurchId;
purchParmTable.PurchName                = purchTable.PurchName;
purchParmTable.DeliveryName             = purchTable.DeliveryName;
purchParmTable.OrderAccount             = purchTable.OrderAccount;
purchParmTable.CurrencyCode             = purchTable.CurrencyCode;
purchParmTable.InvoiceAccount           = purchTable.InvoiceAccount;
purchParmTable.ParmId                   = purchParmUpdate.ParmId;

// Set PurchParmLine table
while select purchLine
where purchLine.PurchId == purchTable.purchId && purchline.ItemId == Itemid

inventDim = purchline.inventDim(true);

// Set batch and serial number
if(InventSiteId != ”)
inventDim.InventSiteId = InventSiteId;

if(InventLocationId != ”)
inventDim.InventLocationId = InventLocationId;

if(batchid != ”)
inventDim.inventBatchId = batchId;

if(serialid != ”)
inventDim.inventSerialId = serialID;

if(inventsizeId != ”)
inventDim.inventsizeId = inventsizeId;

if(InventColorId != ”)
inventDim.InventColorId = InventColorId;

purchParmLine.InventDimId = inventDim::findOrCreate(inventdim).inventDimId;

purchParmLine.ReceiveNow    = 1 ; //PurchLine.PurchQty;
purchParmLine.ParmId        = purchParmTable.ParmId;
purchParmLine.TableRefId    = purchParmTable.TableRefId;
purchParmLine.setQty(DocumentStatus::PackingSlip, false, true);

purchFormLetter = PurchFormLetter::construct(DocumentStatus::PackingSlip);

// This is the ID we hard code as the product receipt ID, if we do the posting via UI
// user would have the option to manually enter this value
return “OK”;
catch (Exception::CLRError)
err = CLRInterop::getLastException();
ret = err.ToString();
return ret;
Return “Error”;


Get every new post on this blog delivered to your Inbox.

Join other followers:

error: Content is protected !!