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 :
Microsoft Dynamics AX (Archived)

Creating Sales order using Business Connector C# (C Sharp)

(0) ShareShare
ReportReport
Posted on by

As the title says, I have to create the Sales order using Business connector and C#. I am able to connect AX using business connector but unable to find any help that how can I create a sales order.  I don't know which of the tables will be used and what are the fields which should be taken care of. I am using MS Dynamics AX 2012.

If any body can help?

Thanks in advance,

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Martin Dráb Profile Picture
    237,987 Most Valuable Professional on at

    Do you have any reason not to use the solution that it's in AX out of the box? It's the Sales Order Document Service (AIF).

    Building the same thing again using Business Connector looks like a lot of work for a worse result. Also, the standard code is already tested and it's supported by Microsoft.

    Here is a trivial example of C# code needed to create sales orders.

  • Community Member Profile Picture
    on at

    Sorry for late reply, I was busy with other Module. AIF seems a better option as compared to Business connector but as I am new to AIF, can you please guide me that which DLLs should I include (as reference) in my project. And also how to mention that which instance of Dynamics is to be used? Or AIF will determine itself?

    Please note that I am doing this in a Website.. i.e. ASP.Net (C#) with SQL Server. Dynamics instance will be available on Server.

  • Suggested answer
    Rohin Profile Picture
    4,624 on at

    Like Martin already suggested you the SalesOrder document services is one that you can use. Please try this.

  • Verified answer
    Martin Dráb Profile Picture
    237,987 Most Valuable Professional on at

    It's not a DLL; you'll add a service reference to Visual Studio, which will generate classes for communication via web services.

    You can find an example in Walkthrough: Exchanging documents by using the NetTcp adapter [AX 2012].

  • Community Member Profile Picture
    on at

    While following the tutorial you mentioned, it says

    In the Select service operations form, select SalesSalesOrderService.read in the Remaining service operations list. Click the left arrow to move the service operation to the Selected service operations list. Then, close the form.

    But I was unable to find SalesSalesOrderService.read in "Remaining Service operations", you can check this in following screenshot. (Click image for larger view)


    While doing above I noticed AIFServices in Inbound ports, so I thought the Inbound port for AIF is already added.  I added web service reference for WSDL of AIFServices but SalesOrderServiceClient was not available in code.

    What step am I missing or am I doing something wrong?

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

    Using AIFServices port isn't going to help you in any way, because it doesn't contain any operations related to sales orders. These are infrastructure services for AIF (e.g. AifDiagnosticsService); you can see what it contains by looking at AifServices service group in AOT.

    Your list of available services indeed misses most out-of-the-box services; something is probably wrong with your environment. Recompile the whole application (X++) and generate full CIL; make sure both completes without errors. Then open AifService form and click the Refresh button. If you still don't see some services, check the Error message field for the given service in the AifService form.

  • Suggested answer
    Rohin Profile Picture
    4,624 on at

    I totally agree with Martin, try to Full compile + full CIL if you don't see your service operations there. Even i faced this issue in past but that was customized services not out-of box. Might be you have not performed checklist for AIF when you setup your system.

  • Community Member Profile Picture
    on at

    @Martin Dráb, @Sukrut Parab

    After recompiling whole application (X++) and generating CIL., I tried redoing the process i.e. "Create and configure the integration port",

    But when I reached at step 6 i.e. "6. In the Select service operations form, select SalesSalesOrderService.read in the Remaining service operations list. Click the left arrow to move the service operation to the Selected service operations list. Then, close the form." of the link https://technet.microsoft.com/en-us/library/hh352231.aspx

    I got this error "Cannot create a record in Port document (AifPortDocument). Reference: 0, 14017.
    The record already exists." Here is the screenshot of error

    08255.error.jpg

    What can be the possible cause and solution of this? Please help!

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 > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#1
Priya_K Profile Picture

Priya_K 4

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans