web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Dynamics Connector - Custom Adapter problem writing to AX

(0) ShareShare
ReportReport
Posted on by 2

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

I have the same question (0)
  • Community Member Profile Picture
    on at

    Hi Nick, since the AX 2012 adapter is  dynamic and can read / write to the fields that are exposed by a service in AX 2012, I am wondering why you need to create a custom adapter for AX 2012 at all?  The Adapter and object provider that are supplied out of the box *should* be able to accomplish what you need.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Sanhthosh.Kumar.K Profile Picture

Sanhthosh.Kumar.K 2

#2
Raed Salah Bzour Profile Picture

Raed Salah Bzour 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans