Showing posts with label AIF in AX 2012. Show all posts
Showing posts with label AIF in AX 2012. Show all posts

Thursday, August 25, 2016

Catch exact error message from AX AIF service


when interacting with AX AIF services to catch the exact Error message this is what you would do in your C# Catch block


catch(FaultException<AifFault> ex)
            {
                InfologMessage[] infoLogList = ex.Detail.InfologMessageList;
                foreach (var info in infoLogList)
                {
                    Console.WriteLine(info.Message);
                }

                proxy.Abort();
                Console.ReadLine();
            }

Thursday, April 14, 2016

Item Service in AX 2012- This document does not support the AxEcoResProductIdentifier class or AxEcoResProductCategory class

In AX 2012's Item service as part of creating an Item/Product through AIF Service if you try to populate entities EcoResProductIdentifier, EcoResProductCategory you may receive these errors:

This document does not support the AxEcoResProductIdentifier class
or
This document does not support the AxEcoResProductCategory class

You may very well receive these errors after going through the AIF wizard and regenerating the Item Service (InventTable and EcoResProduct), the reason being wizard doesn't generate some code related to all the Tables involved in the AxdQuery.

To fix this, I had to add following code in class -> AxdEcoResProduct-> prepareForSave()

       case classNum(AXEcoResProductIdentifier):
            axecoResProductIdentifier   = _axdStack.top() as AxEcoResProductIdentifier;
            axEcoResProduct             = axecoResProductIdentifier.parentAxBC() as AxEcoResProduct;
            axecoResProductIdentifier.parmProduct(axEcoResProduct.parmRecId());
            return true;       
        
        case classNum(AxEcoResProductCategory):
            axEcoResProductCategory     = _axdStack.top() as AxEcoResProductCategory;
            axEcoResProduct             = axEcoResProductCategory.parentAxBC() as AxEcoResProduct;
            axEcoResProductCategory.parmProduct(axEcoResProduct.parmRecId());
            return true;       


Ofcourse I had declare the corresponding variables.
Happy Daxing.....




Tuesday, October 7, 2014

AIF Queue Manager is not retaining Erred Request messages


In AIF Asynchronous  integration port (Eg: File Adapter) Queue Manager doesn't  retain Erred incoming request messages if the field "respond after error in aysnchronous request" on the Integration port is checked.


The reason being is - for AIF to respond it needs to do outbound processing, once this field is unchecked on the Integration port AIF doesn't do outbound processing  for erred request messages and therefore message will remain in the Queue Manager.