Microsoft Dynamics AX 2012 : Display field for AIF Outbound

Scenario: Recently i come across a scenario, that I need to expose a form/table field which is actually a displayMethod to outbound integration .My requirement was to expose the EcoResProduct.productSubType().

In order to do that please perform following steps

1. If not already done so, create a display method in the table you are 
exporting. It does not have to be the root table, it can be any table in the 
query.

2. Edit the corresponding AX table class (Ax<table>) by adding a 
parm<display_method> method that returns your display method 
(this.<display_method>()> 

3. Refresh the AIF actions 
4. If you have used the schema earlier, recreate all processes relying on 
the schema at the AIF Endpoint

5. You should be good to go.

 

Examples:

For my new AxBc* class , Class = legInventItem_EcoResProduct_EcoResProduc

public EcoResProductSubtype parmProductSubType(EcoResProductSubtype _value = 0)
{
// added this to send calculated field.
//BP Deviation documented
return EcoResProduct::find(this.get_Attribute(#RecId)).productSubtype();
}

For AxEcoResProduct class, (Use primitive return type)

public str parmProductSubType()
{
return strFmt(‘%1’,ecoResProduct.productSubtype());
}

 

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s