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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Unanswered

X++ code for creating and updating customers with address in ax 2009

(0) ShareShare
ReportReport
Posted on by 184

Hi All,

I have a requirement to create and update customers such as dob,address etc.

Can I get some x++ code for this please? 

Or any blog or link which has the code also fine please.  

Please send me ax 2009 based code

I have the same question (0)
  • D365_Wibes Profile Picture
    184 on at

    Can I have suggestions here please ?

  • Martin Dráb Profile Picture
    237,878 Most Valuable Professional on at

    What are you trying to achieve and what exactly is the problem that you need help with?

    For example, if you want to import customers, this might help you: How to import customers and vendors in Microsoft Dynamics AX 2009. Or you might utilize the existing AIF document service for customers.

    If you need custom code anyway, do you have any particular problem with it? Or do we need to start with the basics such as how to use insert() and update() methods?

  • D365_Wibes Profile Picture
    184 on at

    Hi Martin,

    Thanks for the reply....

    My requirement is to get data from 3rd party tool and based on that create customer if not already exists or update already exists.....

    My main problem is updating address to customer as I don't find code or blog for ax2009.

    Could you please share me the code to update customer address for ax 2009 via CustCustomerService.update operation or any custom code is also fine...

  • Martin Dráb Profile Picture
    237,878 Most Valuable Professional on at

    If you want to use AIF, how do you want to do it? For example, do you want to import a XML file through the file system adapter? Or do you want to consume the SOAP web service? Or something else?

  • D365_Wibes Profile Picture
    184 on at

    Actually from a Third party tool they will consume my custom web service and pass the required parameters for customer,  and based on that if customer already exists it will update or if it does not exists it will create new.

    So could you please let me know how can I create or update data for customers using the parameter they pass such as (CustAccount,CustGroup,Address) etc.,

  • Martin Dráb Profile Picture
    237,878 Most Valuable Professional on at

    Are you saying that you're developing your own web service? If so, it would make sense to call the SOAP service offered by AIF, if the web service will run in the same network as AX 2009 AOS.

    Do you use C# to develop your web service?

  • D365_Wibes Profile Picture
    184 on at

    Yes Martin, you are right I want to develop my own web service.

    And I am not sure how to proceed further on this whether to use C# or we can in x++ it self.

    Really need your suggestion on this please?

  • Martin Dráb Profile Picture
    237,878 Most Valuable Professional on at

    You'll need to think about your architecture before you can write code.

    AX 2009 doesn't have a support for developing and hosting custom web services. If it was enough for you to use the AIF document service, you could expose it to the other system.

    But if you have a need to develop a custom web service, AX isn't isn't the right tool. You should use something like ASP.NET instead. Then the question is what the web service will do - my suggestion was calling the AIF document service.

    Both approaches would use the AIF document service as a web service, therefore you should familiarize yourself with the related documentation: Consume Web Services.

  • D365_Wibes Profile Picture
    184 on at

    Thanks for your suggestion Martin.

    I am struggling with customer address update in C# code.

    Could you please give me a sample code for customer address update using C# by calling CustCustomerService.Update?

    That would be much helpful to me

  • Martin Dráb Profile Picture
    237,878 Most Valuable Professional on at

    Sorry, I don't have that particular piece of code for that particular version of AX.

    But I (and others) could help if you explain your particular problem.

    You said that you have a problem with the address - does it mean that you know how to update other information, such as customer name?

    What exactly are struggling with?

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 646 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 529 Super User 2025 Season 2

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 285 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans