Remove $id from Custom Web Service JSON – Dynamics 365 F&O

Dag CalafellDynamics 3653 years ago25 Views

Priority-Based Throttling in Microsoft Dynamics 365 Finance and Operations (F&O, SCM) is almost mandatory!  If your solution or integration architecture included the transaction orchestration being done outside of F&O (multiple OData calls within a transaction; rollback means making more OData calls), one of the things you can do to adjust it is to create a custom web service in F&O, which would handle an entire transaction.

It is easy to develop a custom web service in F&O by creating the following objects:

  • Class with public method
  • Service
  • Service Group
  • Security Privilege
  • Contract classes, as needed
  • SysTest (ATL) class(es), as much as desire allows

When you want to have a list of objects, you create a DataContract class and return it as a list (see line 22 below).

Ugh, what are these unnecessary $id fields?

Rid yourself of this unnecessary data and bandwidth hog- Use the following decorator on your contract classes to remove those (as seen in above screen shot).

[Newtonsoft.Json.JsonObjectAttribute(IsReference = false)]

The post Remove $id from Custom Web Service JSON – Dynamics 365 F&O appeared first on Dag Calafell, III.

Original Post https://calafell.me/remove-id-from-custom-web-service-json-dynamics-365-fo/

0 Votes: 0 Upvotes, 0 Downvotes (0 Points)

Leave a reply

Join Us
  • X Network2.1K
  • LinkedIn3.8k
  • Bluesky0.5K
Support The Site
Events
March 2025
MTWTFSS
      1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
31       
« Feb   Apr »
Follow
Sign In/Sign Up Sidebar Search
Popular Now
Loading

Signing-in 3 seconds...

Signing-up 3 seconds...