Question

We are working on AX webservices which return some datacontract (obviously).

The datacontract returned has a field (we will call him "endDate") which, sometimes, can be considering "unkwnown". Is there a way to avoid having the element corresponding to this field in the generated XML in this case.

Exemples

endDate known

<datacontract>
    <field1>value</field1>
    <endDate>2010-10-10</endDate>
</datacontract>

endDate unknwown

<datacontract>
    <field1>value</field1>
</datacontract>

I would like to avoid having two type of datacontract, of course.

Was it helpful?

Solution

The easy option is to remove the unwanted fields from the service query.

Also in the setup of the outbound port you can configure which fields to expose (under "Data policies". You cannot when configuring inbound ports.

On output AIF always emits the elements whether or not it contains data. For example:

</endDate>

if the endData is not set.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top