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

Announcements

No record found.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
CP04-islander Profile Picture

CP04-islander 16

#2
GiacomoRovai Profile Picture

GiacomoRovai 4

#3
Douglas Noel Profile Picture

Douglas Noel 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans