In this example I'm going to assign a value in the Header section of an AIF message with BizTalk. An AIF message is defined by two XSD schemas. You have an envelope and a document that defines which tables are mutated in Dynamics. The elements in the Header are part of the Envelope. XML example of an AIF message.
The example above is a Dynamics AX 4 message. There are some small differences with Dynamics AX 2009 but the principle is the same. The XML documents have for example other namespaces and in action element are other values allowed.
There are more elements in the Header section but in this example I'm only going to set the value in the action element. This element contains information that uniquely identifies the service operation to the system and is a required element. To set the Action value I'm going to use Promoted Properties.
First you have to create a property schema with the elements you want to set.property schema
After that you import in your BizTalk project the Envelope schema and the schema that defines the Dynamics table that you want to mutate.envelope schema
Then you have to promote the elements in the envelope schema.promote Action property
In an Orchestration you can set the value of the promoted field with the "Message Assignment" component.Assign the value
In the example code beneath you see how the Action property of the "msgSalesOrder" message is set
//Assign Header valuesmsgSalesOrder(AIFExample.Action)= "createSalesOrder";
Notice that in the orchestration you work with the document that defines the table that you want to mutate. You don't have to worry about the envelope. The Dynamics AX adapter in BizTalk puts the document in the envelope and sends the envelope to Dynamics.
For more information about AIF Messages go to MSDN
Microsoft Dynamics AXAIF Messages http://msdn.microsoft.com/en-us/library/aa627117(AX.10)..aspx
I am a BizTalk consultant at Motion10 and have developed software for more than 12 years. I developed a lot of different types of software like SQL databases, webservices, websites and BizTalk applications. Some in other languages and techniques than Microsoft but at a certain point you have to choose and I like the way how their products can interact with each other and Microsoft has great tools for the developer!I am 37 years old, live in Rotterdam and have a wife and a kid called Max.