AX 2012 AIF Outbound port Data Policy - override mandatory fields

481 views Asked by At

I'm on AX 2012 R3 CU10.

I need to export Items data in XML format.

I've created an outbound AIF port, based on service operation EcoResProductService.read.
While selecting Data policies, AX won't let me untick the checkbox for /EcoResProduct/Product/Translation/LanguageId (grayed out), because that is a mandatory field in the underlying table.
This can be overridden by adding it to the initMandatoryFieldsExemptionList method of the AxBC class. Example here

So, I've overridden it on \Classes\AxEcoResProductTranslation\initMandatoryFieldsExemptionList

protected void initMandatoryFieldsExemptionList()
{
    super();

    // LanguageId not mandatory
    this.setParmMethodAsNotMandatory(methodstr(AxEcoResProductTranslation,parmLanguageId));

}

However, the checkboxes in Data policies still remain grayed out after that.
Things I've tried:

  • Forward compile of modified AxBC class
  • Incremental CIL
  • Restart AOS
  • AX Client config > tab:Connection > button:Refresh configuration

When I compare my code to standard code, like on AxAssetTable, there the initMandatoryFieldsExemptionList is implemented and works correctly.
AssetId is not grayed out in the data policies for that one.

Does anyone know how to make AX "see" my exemption for LanguageId?

1

There are 1 answers

0
Jay Hofacker On BEST ANSWER

You need to get the system to update the AIF schema table. You can do this by right clicking on the service in the AOT under Services and clicking Add-Ins/Register service, or open the form AifService and click the Refresh button to update all services.