Overview delete action in Dyanmics AX 2012

We normally create action delete in foreign table to make sure referential integrity in Logic and validation. The delete action has the following options: None, Restricted, Cascade, Cascade + Restricted 1. None: This has no effect, and effectively disables the delete action. This is useful if you want to specifically state do nothing so that someone else doesn’t try to correct what seems to be an omission. 2. Restricted: This will prevent the record from being deleted if there are records in the related table that match the selected relation.

Handle AIF error messages in dynamics AX 2012 R3

Normally, when we consume AIF Service, we use this code like below to handle Error messages 1 2 3 4 5 6 7 8 9 10 11 try { client.register(ctx, contract); Console.WriteLine("items registed on Trans Id: " + contract.InventTransId + " with " + contract.Qty + " quantities."); Console.ReadLine(); } catch (Exception ex) { Console.WriteLine(string.Format("Ex: {0}", ex.Message)); Console.ReadLine(); } If it cause error, message would return like this If you want to know more details, you have to go In Dynamics ax AIF Exceptions form then check

How to create HTTP adapter port

We normally use NETTCP adapter for .NET system, It going to very easy to consume by. As my experience, if we use NETTCP adapter for consuming by Java system, we will need add some extension or 3rd party due to binding and mismatch schema and of course client doesn’t want to do that either me. So, my solution is creating HTTP adapter for Java, you can also use .NET system to consume HTTP adapter without any problems

Response in AIF custom service class

At the previous post I already show how to customize Response Value list in AIF Document standard service, today we will talk about response in Custom AIF service class. We already know for Custom AIF service we actually need 2 classes, one is contract for data input and one is service to process a logic. With Response class, it’s literally same with contract class. They both hold parm value. contract class gets parametters.

AIF Custom response value in Dynamics AX 2012 R3

For this demonstration, I use AIF service to create Sales order with SalesSalesOrderService and I gonna consume AIF using C#.NET. Normally, in consume service application we handle return value by using EntityKeyList, EntityKey, KeyData[0].Value. And for Sales Order It will return Created SalesID. Let’s take a look on AxdSalesOrder class. More about Axd class please prefer this. Then go to createList method, this method will handle response value 1 2 3 4 5 6 7 8 9 10 11 12 13 14 public AifEntityKeyList createList( AifDocumentXml _xml, AifEndpointActionPolicyInfo _actionPolicyInfo, AifConstraintListCollection _constraintListCollection) { AifEntityKeyList aifEntityKeyList; aifEntityKeyList = super(_xml, _actionPolicyInfo, _constraintListCollection); // Sales orders are committed - master planning explosion can be executed and confirmed dates be set this.

How to block vendor and send email for notification.

Main requirements is Using batch to find and block vendor base on last transaction condition and notify for them by emails. 1. Set up E-mail parameters For set up email, we need Go to AX System administrator > Setup > E-mail parameters 2. Vendor emails Vendor emails locate on LogisticsElectronicAddress.Locator, partyTable.PrimaryContactEmail, partyLocation.Location, please take a look on this job to find how to update Vendor emails and you also could see the relations more clearly.

Simple summary Keys are in Dynamics AX

There is a maximum of one Primary Key per table, whereas a table can have several alternate keys. The primary key is usually the type of key that other tables, called child tables, refer to when a foreign key field in those other tables need a relational identifier. For new tables the default is a primary key based on the RecId field , incremented number or a completely meaningless number that is generated by the system surrogate key.

AX1004 error in Dynamics AX

I got this error at version Dynamics 2012 R3 CU9, SQL Server 2014, Windows Server 2012 R2. Those kind of errors will come when you move report from Dev Server to Live Server, even compilation in DP Class, Query, Contract, table … without any error Image_rounded AX1004: Reference System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 was not a valid model assembly. MSB3644: The reference assemblies for framework “.NETFramework,Version=v4.0” were not found. To resolve this, install the SDK or Targeting Pack for this framework version or retarget your application to a version of the framework for which you have the SDK Cause There is no reference Assemblies Version 4.