Hi,
Has anyone else attempted to create a custom adapter using the Dynamics Connector SDK, which writes to AX2012?
I have created an adapter which reads XML (based on the sample adapter). I have created a Map which reads the XML and attempts to create an Customer, using the out-of-box 'Conn Customer Org Service'. Currently, upon writing to AX, only a record in the 'CustTable' is being created, despite me adding details to the 'DirOrganisation' in the Map. I have pasted the auto-generated transform code from the map below.
I have also attempted to get around this problem by creating a custom mapping function, which returns a Dictionary<string, object]{} array, but still hit the same problem.
Has anyone successfully created a custom Mapping which writes to AX? Have I missed something in my mapping which creates the link between CustTable and DirOrganisation?
Any help will be much appreciated!
Thanks,
Nick
private System.Collections.Generic.Dictionary<string, object> _(System.Collections.Generic.Dictionary<string, object> source)
{
System.Collections.Generic.Dictionary<string, object> _ = new System.Collections.Generic.Dictionary<string, object>();
_["Currency"] = ( ((source != null)
&& (source.ContainsKey("Currency") == true)) ? ((string)(source["Currency"])) : default(string) );
_["CustExcludeCollectionFee"] = Microsoft.Dynamics.Integration.Mapping.Helpers.CrmAx.CrmAx2012Helper.ConvertToYesNoFromBoolean(false);
_["CustExcludeInterestCharges"] = Microsoft.Dynamics.Integration.Mapping.Helpers.CrmAx.CrmAx2012Helper.ConvertToYesNoFromBoolean(false);
_["CustGroup"] = ( ((source != null)
&& (source.ContainsKey("CustomerGroup") == true)) ? ((string)(source["CustomerGroup"])) : default(string) );
_["TaxGroup"] = "DOMVAT";
List<System.Collections.Generic.Dictionary<string, object>> Organization = new List<System.Collections.Generic.Dictionary<string, object>>();
Organization.Add(this.Organization_Item(source));
_["Organization"] = Organization.ToArray();
return _;
}
private System.Collections.Generic.Dictionary<string, object> Organization_Item(System.Collections.Generic.Dictionary<string, object> source)
{
System.Collections.Generic.Dictionary<string, object> Organization_Item = new System.Collections.Generic.Dictionary<string, object>();
Organization_Item["NumberOfEmployees"] = 150;
Organization_Item["OrgNumber"] = "12345678";
Organization_Item["Name"] = "Test Company Title";
return Organization_Item;
}
*This post is locked for comments