Property ‘field’ on type ‘Microsoft.Dynamics.CRM.entity’ is not a navigation property or complex property. Only navigation properties can be expanded

This is a common error message when you are trying to use multi-type lookup fields(i.e regardingobjectid, customerid, activityid) in odata requests to expand(join) entities. It basically says the lookup field you are expanding to does not have a navigation property for that entity. You just need to tell the web api which entity you are expanding to. To do that you just simply add _entitylogical name to that lookup field.

Here is some examples:

  • For connection entity you want to expand to account or opportunity entity for “record1id” field. Not that record1id can be account, contact, quote, order … entity types.
    $expand=record1id_account($select=accountnumber,name)
    $expand=record1id_opportunity($select=opportunityid,subject)
  • For contact entity you want to expand to account entity for “parentcustomerid“. Note that “parentcustomerid” is Customer type, means it can be both account or contact record.
    $expand=parentcustomerid_account($select=accountnumber,name)

One thought on “Property ‘field’ on type ‘Microsoft.Dynamics.CRM.entity’ is not a navigation property or complex property. Only navigation properties can be expanded

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s