This code project has a code which will guide you, if you want to integrate purchase cost from any other system in to D365 for finance and operations. This service creates trade agreement journal header and lines both. All lines are created by reading values coming from JSON payload. If the trade agreement already exist, service sets a to date on it to make it expire. This project has also code to archive trade agreements.
You can follow below steps to get this service working.
- Download code from Github repo.
- Unzip the file and import project or put xml files into your model folder
- Refresh models from visual studio and build your model.
- Once your build is successful, you can access this service using following endpoint
You can use postman to test this service.
The JSON payload and sample postman request for this service looks like below which you can download from the github.