Simple way to extend AIF outbound data in AX 2012

Let’s assume that we need to extend standard ASN Packing Slip XML with contact name and phone. Related AIF service class is using standard query AxdASN. The root data source table is CustPackingSlipJour.

There is related class axCustPackingSlipJour. We need just to add to this class parm methods returning wanted values: parmContactPersonName and parmContactPersonPhone.
public ContactPersonName parmContactPersonName(ContactPersonName _contactPersonName = ”)
{
return custPackingSlipJour.salesTable().contactPersonName();
}
public LogisticsElectronicAddressLocator parmContactPersonPhone(LogisticsElectronicAddressLocator _contactPersonPhone = ”)
{
return LogisticsElectronicAddress::findRecId(DirPerson::find(custPackingSlipJour.salesTable().ContactPerson().Party).PrimaryContactPhone).Locator;
}
We need to refresh AIF services to see the added parameters.

After refreshing changes in the related schema should be visible:

We need to enable elements in Document Data Policies in Outbound Ports:

and finally new elements should be visible in XML file:

See more

AGA pomaga – poznaj inteligentnego asystenta do przetwarzania zapytań ofertowych: ANEGIS Generative Assistant

Jak z pomocą narzędzi Power Platform, Microsoft Fabric i AI zrealizować plan na cyfrową transformację? ANEGIS Power Center

Obowiązkowy KSeF startuje za 4 miesiące! Umów się na bezpłatne konsultacje i przygotuj swój system na zmiany
Let's talk about your project
Let us know what you need: implementation, migration, system development, or a question you’re looking to have answered. We’ll get back to you with a concrete proposal for the next step - not a sales pitch.

