Sys Operation framework – Adding Class to Batch Task/making Journalized

Problem statement:

We have batchable  class that needs to be added to Batch Task form (System Administration> Batch>View Task) so we can plan batch job executions like if any dependencies or sequencing needs to be managed between the batch classes.

For such tasks class should be Journalized.

We know that if we are using old RunBaseBatch framework we can make the class Journalized by overriding the method canGoBatchJournal() and let it return true.

But if we have implemented the Batch using new SysOperation framework then we need to following things.

We need to have Controller class, as Batch task will be scheduled based on it.
Controller class needs to be decorated using attribute “[SysOperationJournaledParametersAttribute(true)]”
Main and new method should have important information provided as heighted below. These needed for initializing the parameters in Batch Task.

6-3-2016 9-55-47 PM

6-3-2016 9-56-33 PM

6-3-2016 9-57-03 PM

Thanks you

Happy Daxing🙂

Deprecated features in AX 7


Complete list is available on above link for the deprecated features in AX7 but the important one to me as Technical on AX is AIF service. here is statement from Microsoft about it. I will share separate blogs about the replacements and defiantly in AX7 we have better options for implementing the integrations.

In Application Integration Framework (AIF), data can be exchanged with external systems through business logic that is exposed as services. Microsoft Dynamics AX includes services that are based on documents and .NET Business Connector (AxBC). A document is created by using XML. The XML includes header information that is added to create a message that can be transferred into or out of Microsoft Dynamics AX. Examples of documents include sales orders and purchase orders. However, almost any entity, such as a customer, can be represented by a document. Services that are based on documents use the Axd <Document> classes.

Reason for deprecation The architecture of AIF and AxDs could not be scaled to a cloud service. There were performance issues around bulk import.
Replaced by another feature? In the current version of Dynamics AX, this feature is replaced by Data Import/Export framework, which supports recurring bulk import/export. For AxBC, we recommend that you use the actual tables.
Modules affected AxDs, AxBCs, and AIF

Consuming Pending Vendor invoice service from C#

This blog refers to consuming or creating Pending vendor invoice record in dynamics ax 2012 R3 using out of box service “VendVendInvoiceService”. The focus of this blog is .net C# side. In this example I took the complex case of creating Vendor invoice that linked to multiple PURCHASE ORDERS in received status.

This ADDHeader method insert record in VendInvoiceInfoTable, for this example I just filled the required ones.


This ADDLine method insert a line in VendInvoiceInfoLine table. this is helper method will be called from main executing point.


This is the main executing method, In this method I did initialization of required objects, make find call of two purchase order records using Purchase order service (You could do this by any way, hard coded or service call or through .net proxies). Here I am also making the call of AddHeader method to create the header record


Further on the same method, call AddLine to create Line record, Also specify the QTY that how much I want to invoice from the receiving, I did the same for both the purchase orders.


After composing complete message, making Create call to service


Amir (Happy Daxing)


Settlements (Technical Utility methods)

Piece of code that checks if the invoice is already marked with some payment or not

 protected boolean checkIfAlreadyMark(CustVendTransOpen _custVendTransOpen)  
   specTransManager specTransManager = specTransManager::construct(_custVendTransOpen);  
   return specTransManager.existForOtherSpec(, _custVendTransOpen.TableId, _custVendTransOpen.RecId);  

Piece of code that settles the invoice with the payment

 protected void markSettlement(CustVendTransOpen _custVendTransOpen)  
   CustVendOpenTransManager manager = CustVendOpenTransManager::construct(ledgerJournalTrans);  
   manager.updateTransMarked(_custVendTransOpen, true);  
%d bloggers like this: