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, ...
Suggested answer

Sales order creation through Logic apps in D365FO

(3) ShareShare
ReportReport
Posted on by 1,213
Dear team,
 
I need some basic idea before implementing the same...
 
As I need to create a Sales order in D365FO through Logic app.
 
So, I think we need entities SalesOrderHeaderV2 entity and SalesOrderLineV2 entity for this requirement.
 
The third party application going to send us the file in JSON below format like 
 
For example -
 
Header -
Sales Id- 'ES0001'
Customer account etc...
 
Lines -
Item id - 'I001'
Qty - 10 etc...
 
Header -
Sales Id- 'ES0002'
Customer account etc...
 
Lines -
Item id - 'I002'
Qty - 10 etc...
 
So on ...
 
***My question is pls guide me the below things
 
1. How will I call the entities SalesOrderHeaderV2 entity and SalesOrderLineV2 entity in Logic app. I am looking for the trigger.
 
2. How will I loop to create header+line in D365FO for each combination from Logic app.
 
3. If suppose any records failed to import in D365FO for any reason, is it skiped automatically and go to the next record?
 
4. Can I get the logs in Execution history?
 
Kindly advise me pointwise pls.
 
I will implement the same accordingly.
 
Thanks in advance 
 
 
 
 
Categories:
I have the same question (0)
  • Suggested answer
    Sagar121 Profile Picture
    741 on at
    Sales order creation through Logic apps in D365FO
    1. How do I call the entities SalesOrderHeaderV2 and SalesOrderLineV2 in a Logic App?
    You can use the Finance and Operations connector in Logic Apps. Simply type 'Fin&'  and you will see all triggers(Only business event) and actions related to F&O.
    To create records you can use create record F&O connector.
    2. How do I loop to create header and line in D365FO for each combination from Logic App?
    It depends on the input( One SO or multiple SO) You will need to know exact format.( For this learn about Object and Arrays) in LA. 
    3. If any records fail to import in D365FO for any reason, are they skipped automatically and does it move to the next record?
    Yes assume you have 5 lines in SO. If line2 fails it will get skip and LA will run for others. For better error handling, you can write custom logic in the data entity. behind the screen data entity code runs when you use LA connectors for F&O
    4. Can I get the logs in Execution History?
    Yes. Logic Apps provides Execution History where you can view details of each run. In LA you will need to use Scope learn about this topic as in LA you don't have direct try and catch.
     
  • CU05031448-0 Profile Picture
    1,213 on at
    Sales order creation through Logic apps in D365FO
    Thanks Sagar for the response.
     
    2. As you said 'It depends on the input( One SO or multiple SO) You will need to know exact format.( For this learn about Object and Arrays) in LA. '
     
    Actually as per our discussion, they going to send TEN SO per day. 
    So, please let me know where I can store it? Kindly tell me the best approach.
    As I need to do Recurrence integration. So, it will pick automatically JSON file from there.
     
    Kindly let me know the best approach pls.
     
    You mentioned 'LA'. It means Logic Apps?
     
    3. As you suggested me to write the custom Logic in Data Entity. Pls let me know which method is good to write the logic 
     
    How the method will called in Logic app?
     
    Kindly elaborate pls.
     
    Thanks in advance.
     
     
  • CU05031448-0 Profile Picture
    1,213 on at
    Sales order creation through Logic apps in D365FO
    Kindly reply on this pls. Thanks!
  • Sagar121 Profile Picture
    741 on at
    Sales order creation through Logic apps in D365FO
    2. As you said 'It depends on the input( One SO or multiple SO) You will need to know exact format.( For this learn about Object and Arrays) in LA. '
     
    Actually as per our discussion, they going to send TEN SO per day. 
    So, please let me know where I can store it? Kindly tell me the best approach.
    As I need to do Recurrence integration. So, it will pick automatically JSON file from there.
     
    Kindly let me know the best approach pls.
     
    You mentioned 'LA'. It means Logic Apps? : Yes
    You can use Recurrence trigger. I would recommend using a Blob Storage account to store these files. Once the files are uploaded, you can retrieve their content. After that, use the Parse JSON connector in your Logic App. Provide a valid sample JSON payload, the connector will automatically generate the JSON schema for you. Then, you can use those parsed fields in your F&O connector to create records.
     
    3. As you suggested me to write the custom Logic in Data Entity. Pls let me know which method is good to write the logic 
     
    How the method will called in Logic app?:-When you use the F&O Logic App connector, it will call your Data Entity methods. So, even if you create records from the Logic App, your Data Entity methods will still be respected and executed.
  • CU05031448-0 Profile Picture
    1,213 on at
    Sales order creation through Logic apps in D365FO
    Thanks Sagar for the valuable response.
     
    Pls. let me know ,
     
    1. In data entity, Which method is recommended to write custom Logic. So, that it will NOT cause performance issue. 
     
    Kindly elaborate pls.
     
    2. how will I call
    SalesOrderHeaderV2 and SalesOrderLineV2 entities in Logic app to create Sales order in D365FO? I mean where I will trigger those entities in Logic app.
     
    Kindly elaborate please.
     
    Thanks in advance.
  • CU05031448-0 Profile Picture
    1,213 on at
    Sales order creation through Logic apps in D365FO
    Kindly advise pls 
  • CU05031448-0 Profile Picture
    1,213 on at
    Sales order creation through Logic apps in D365FO
    Pls reply on this 
  • Suggested answer
    André Arnaud de Calavon Profile Picture
    300,291 Super User 2025 Season 2 on at
    Sales order creation through Logic apps in D365FO
    Hi,
     
    Note that this is a public forum monitored by volunteers around the world in different time zones. There is no need to add a reply with "please reply on this" every several hours. People will usually also need to work and get some sleep. There are notifications in case someone replied before. When they have their spare time, they can follow up on questions.
     
    Related to question 3 where you ask about error handling. I doubt if any additional logic on the data entity in F&O will help with error handling. Suppose the header is created and 1 out of the 7 order lines has an issue, there is no roll-back option apart from deleting the created records within your logic app.
     
    In Logic App, you can select to continue or stop. You can also consider sending an email to a person in case of an error, so this person can check the order for issues and potentially add a missing line manually.

    You also asked about a trigger. Note that the receipt of the source file should trigger the Logic App. Then in the Logic App as mentioned by Sagar121, you can loop the source file and use the Fin & Ops connector (or Dataverse with virtual tables) to create records. This is using actions, but is not the trigger itself.
    About the differences between the Fin & Ops and Dataverse connector, you can read more on my blog: Battle of the Connectors - Microsoft Dataverse vs Fin & Ops Apps (Dynamics 365) - Dynamicspedia
  • CU05031448-0 Profile Picture
    1,213 on at
    Sales order creation through Logic apps in D365FO
    Hi Andre, I know it's public forum. I post like " "pls reply on this" because to reminder purpose only. And my question will comes in the queue in top. I am not forcing anyone to reply on my question first. Pls don't take in wrong way. Nothing else.
     
    I hope you understand.
     
    My original last post --
     
    1. In the data entity, Which method is recommended to write custom Logic. So, that it will NOT cause performance issue. 
     
    2. how will I call
    SalesOrderHeaderV2 and SalesOrderLineV2 entities in Logic app to create Sales order in D365FO? I mean where I will trigger those entities in Logic app.
     
    Kindly advise please pointwise. Thanks!
     
     
  • CU05031448-0 Profile Picture
    1,213 on at
    Sales order creation through Logic apps in D365FO
    Hi team, Once available, pls advise. Thanks!

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…

Pallavi Phade – Community Spotlight

We are honored to recognize Pallavi Phade as our Community Spotlight honoree for…

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

#1
Martin Dráb Profile Picture

Martin Dráb 628 Most Valuable Professional

#2
CU05031448-0 Profile Picture

CU05031448-0 578

#3
André Arnaud de Calavon Profile Picture

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

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans