Dynamics 365 Web Api – How to Set Lookup Field Value

When updating lookup values, or using lookups in entities you must use the @odata.bind annotation to set the value.

The syntax for this is: {field_name@odata.bind: “/entitypluralname(guid)”}

Some examples:

  • ownerid@odata.bind:”/systemusers(a30cbf7b-69cd-4299-b468-b4978f716af7)”
  • opportunityid@odata.bind: “/opportunities(a30cbf7b-69cd-4299-b468-b4978f716af7)”

For lookups that have different possible entity types(i.e regardingobjectid), this changes slightly (note the entity logical name at the end of the “name”)

  • parentcustomerid_account@odata.bind = “/accounts(a30cbf7b-69cd-4299-b468-b4978f716af7)”

Hope this helps 😊

One response to “Dynamics 365 Web Api – How to Set Lookup Field Value”

  1. […] (note the entity logical name at the end of the “name”) parentcustomerid_account@odata.bind … Continue reading Dynamics 365 Web Api – How to Set Lookup Field Value Read Complete Post and Comments $(document).ready(function(){ if(”!=”) { $(“.post […]

Leave a reply to Dynamics 365 Web Api – How to Set Lookup Field Value – Microsoft Dynamics 365 Community Cancel reply