Action after salesOrder API Post

ROmar
Member Posts: 2
Hi everyone,
Is it possible to perform an action (say release order), after an order is created trough API? I can release the order after one salesLine on OnInsert trigger, but not after multiple lines are posted.
Would appreciate any insight.
Thanks.
Is it possible to perform an action (say release order), after an order is created trough API? I can release the order after one salesLine on OnInsert trigger, but not after multiple lines are posted.
Would appreciate any insight.
Thanks.
0
Answers
-
The best way to do it would be using OData Bound Actions (https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/devenv-creating-and-interacting-with-odatav4-bound-action
The service creating the order would call an extra endpoint with function "Release".
If it's not possible to modify the external service, you could set up a Job Queue - save the session and user ID when creating the order, and then check if the session no longer exists. If it's not there, then the call was finished and you can release the order. This, of course, assumes that both header and lines are created in a single call.0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions