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

Community site session details

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

Creating a Release Order from agreement via OData

(1) ShareShare
ReportReport
Posted on by 52
Hi everyone! 
I am attempting to create a release order programmatically. Typically using the D365 portal, this would be done by finding a sales agreement, and click Release order from the New tab: 
 
My environment on Visual Studio is setup in a similar manner as the Github sample ODataConsoleApplication: https://github.com/microsoft/Dynamics-AX-Integration/tree/master/ServiceSamples 
 
I generated the latest entities made available using the Connected Services extension and have data entities such as SalesAgreements now available. However, I do not have one for release orders - it seems like it is not a data entity made available. Thus I cannot use it in the same way SalesOrderHeader can be used to create a sales order collection.
 
Therefore, how can I create a release order programmatically please? 
 
Thanks in advance!
I have the same question (0)
  • Martin Dráb Profile Picture
    236,316 Most Valuable Professional on at
    Creating a Release Order from agreement via OData
    If I understand the business process correctly, there is no separate "release order". The process of releasing creates a sales order from the agreement.
  • Mar23 Profile Picture
    52 on at
    Creating a Release Order from agreement via OData
    Thanks for your reply Mr Dráb.
    So what is the difference when releasing an order from the sales agreement and creating it directly from the sales orders page (from the portal)? 
    Does it get some data from the sales agreement when creating the sales order? Is it linked? 
     
  • Martin Dráb Profile Picture
    236,316 Most Valuable Professional on at
    Creating a Release Order from agreement via OData
    I'm not a functional consultant and it's a long time since I worked with this process for the last time.
     
    If I remember, using the release process gives you dialog where you can select what should be taken from the agreement, and some other parameters. But you also can create a sales order directly and set the agreement ID there.
     
    I strongly recommend that you familiarize yourself with the business process, decide which steps you want to follow and test them manually through GUI. This will also tell you which input parameters you'll need. Start writing code only when you know which exact steps you want to automate.
  • Mar23 Profile Picture
    52 on at
    Creating a Release Order from agreement via OData
    Once again, thanks for your reply Mr Dráb.
     
     
    However, I cannot find how to link a sales order with a sales agreement when creating a sales order directly. I added the customer requisition and reference numbers, but when attempting to enter quantities larger than those specified in the agreement, I am not getting any errors. So I am suspecting that the agreement was not linked after all. 
  • Martin Dráb Profile Picture
    236,316 Most Valuable Professional on at
    Creating a Release Order from agreement via OData
    Well, maybe you should create a new thread about the process inside F&O, discuss it with functional consultants and then return back and talk about integration via OData here.
     
    Anyway, according to what I see in code, it seems to me that you can link an agreement (in SalesTable form) by using opening Update line menu above the line grid, locating Sales agreement group and clicking Create link.
  • Mar23 Profile Picture
    52 on at
    Creating a Release Order from agreement via OData
    Thanks for the steps you provided. 
     
    So if I wanted to implement the below screenshot programmatically, with the same checks (e.g. not exceeding quantity), what would be the best way to do it in your opinion?
  • Martin Dráb Profile Picture
    236,316 Most Valuable Professional on at
    Creating a Release Order from agreement via OData
    Well, when I said you should test the process in GUI, I didn't meant that you should forget the process  and focus on GUI only.
     
    Will "implement the below screenshot programmatically" create a sales order from an agreement? Not at all. This is just the step in the process where you're configuring parameters; it's not the creation itself. That happens when you confirm the dialog.
     
    It's possible - but by no mean certain - that you'll decide that you want an external system to populate exactly the same set of parameters, and you'll design input parameters of your integration accordingly. It depends on a lot on business requirements, e.g. what information is available in the other system and which parts should be done automatically instead of having to be specified explicitly.
     
     
  • Mar23 Profile Picture
    52 on at
    Creating a Release Order from agreement via OData
    At this stage, I am just looking of replicating the release process to create a sales order from the agreement. In that way, we would automatically have the data retrieved from the sales agreement and be used for the sales order. And we would also have checks which would say that there are conflicts between the input data and the data from the sales agreement. 

    Again, I am not sure what the best way to implement this would be. Since there is no ReleaseOrderHeader just like the SalesOrderHeader, at least, that I am aware of. And there is also no parameter for sales agreement ID in SalesOrderHeader.

  • Martin Dráb Profile Picture
    236,316 Most Valuable Professional on at
    Creating a Release Order from agreement via OData
    Last time you said you want to "implement the dialog for parameters" programmatically, but now it sounds you don't want it at all, because you're fine with mere agreement ID and you don't need any other parameters at all. Is it the case? If so, that makes things easier, because we can completely forget your previous requirement about the dialog.
     
    As I mentioned, you should check the process in GUI, before you try to automate it. Now it seems you want the process where you specify an agreement ID when creating a sales order, instead of the process of releasing an order from an agreement and specifying in the dialog how the order should be created.
     
    If that's the case, a reasonable approach is looking at how the logic works. You'll find that SalesCreateOrder form has editSalesAgreementId() method for this purpose, which calls - most inportantly - SalesTable.initFromSalesAgreementHeader(). This logic doesn't seem to be called by any data entity, but you can change that, because entities can be extended.
  • Mar23 Profile Picture
    52 on at
    Creating a Release Order from agreement via OData
    I have been looking at the GUI, releasing sales order from the portal to get an understanding of how it works. To clarify, I do not want to create an UI aspects, I just want to have functionality to release a sales order from the backend. 
     
    I am still not sure how the best way to approach it would be; whether it should just be linked using a Sales Agreement ID and manually getting information from the sales agreement to the sales order, or if there is a way that this can be done automatically when releasing a sales order. I don't know what sort of functionality is made available and I cannot seem to find documentation. What do you suggest? 
     
    Moreover, when you say "You'll find that SalesCreateOrder form has editSalesAgreementId() method for this purpose, which calls - most inportantly - SalesTable.initFromSalesAgreementHeader(). This logic doesn't seem to be called by any data entity, but you can change that, because entities can be extended."  Do I have access the these methods (editSalesAgreementId() and SalesTable.initFromSalesAgreementHeader()? If so, where can I find these? And how would these be used? Should a new class for a ReleaseOrder be created which extends from the SalesOrderHeader and adds additional properties, such as the SalesAgreementId? But then, how can this class be used to save a released sales order if the sales orders do not have these parameters? 

    Thanks in advance.
     

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…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

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

#1
CA Neeraj Kumar Profile Picture

CA Neeraj Kumar 2,157

#2
André Arnaud de Calavon Profile Picture

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

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 674 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans