Skip to main content

Notifications

Announcements

No record found.

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

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    Re: Dynamics Connector - Custom Adapter problem writing to AX

    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

Congratulations 2024 Spotlight Honorees

Kudos to all of our 2024 community stars! 🎉

Meet the Top 10 leaders for December

Congratulations to our December super stars! 🥳

Start Your Super User Journey Pt 2

Join the ranks of our community heros! 🦹

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,820 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,514 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans