Notifications
Announcements
No record found.
We want to make an API to retrieve data from Finance and Operations then we will call it in Field Service. In the API we want to call a class from Finance and Operations to apply some business logic to the data.
So, anyone can help me how can we do that?
Hi CSafwat,
You have two options here:
- Create a data entity with actions -> docs.microsoft.com/.../odata
- Create a custom service -> docs.microsoft.com/.../custom-services
When I read your question, I think the second option would better meet your requirements. Microsoft is using the same for the Timesheet app where it communicates with a custom service.
There are lot of ways to do that . Take a look at integration statergy link below
docs.microsoft.com/.../integration-overview
You can write a custom service or create data entity and use it in odata .
Thanks André and Sukrut for your reply.
To be more dedicated, we would like to use several validation methods from Dynamics 365 F&O itself. Could we use the existing methods and classes from Dynamics 365 F&O or we have to read and reapply the business logic from scratch?
If Yes, could you give me code example or a tutorial to follow?
If No, What is the best solution as we are integrating between Dynamics 365 (Field Services) and Dynamics 365 F&O and we have lots of validations that must be checked before posting a transaction.
You can call existing business logic in custom action or in custom service and i do agree with Andre about using custom service for your requirement. Take a look at the below links to see example of both
Custom service -
vishwad365fo.blogspot.com/.../custom-service-to-create-sales-order.html
daxonline.org/1580-simple-custom-service-implementation-example-d365.html
Odata action
vishwad365fo.blogspot.com/.../testing-odata-actions-in-d365.html
The standard documentation linked by Andre has some examples as well. In those you will find a link for github projects which will give you some more examples.
You could use custom services to access AX business logic from outside, and you can create data contract for the custom service.
Please see the DOC:docs.microsoft.com/.../walkthrough-exposing-an-x-class-as-a-data-contract
It's applicable to D365fo as well, although it's a document of ax2012.
Hope this helps.
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.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Martin Dráb 565 Most Valuable Professional
André Arnaud de Cal... 450 Super User 2025 Season 2
Sohaib Cheema 250 User Group Leader