30 Jul’17

Dynamics 365, EnterpriseSet Customer Type field in D365 Javascript Web API

Introduction:

This blog explains how to set Customer Type field in D365 Javascript Web API.

Problem Statement:

We get error while setting value of Account lookup on Contact in D365 Javascript Web API as below:
“An undeclared property ‘customerid’ which only has property annotations in the payload but no property value was found in the payload. In OData, only declared navigation properties and declared named streams can be represented as properties without values.”

Solution:

We can achieve this functionality by adding suffix entity name to the schema name of the field.

Steps of Implementation:

Below code demonstrates how to set Account on Contact.

entity["parentcustomerid_account@odata.bind"] = "/accounts(" + Account_GUID + ")";

Below code demonstrates how to set Contact on Contact.

entity["parentcustomerid_contact@odata.bind"] = "/contacts(" + Contact_GUID + ")";

Note: This issue arises when lookup attribute of the entity can accept multiple types of entity references below are common examples
1. Customer on Incident
2. Customer on Contact
3. Customer type field on Custom Entity.

Conclusion:

We can resolve issue for setting Customer type field in Javascript D365 Web API by adding suffix entity name to the schema name of the field.

Written by

Shailesh Wath

ERP Consultant

Leave a Reply

Your email address will not be published. Required fields are marked *

Time limit is exhausted. Please reload the CAPTCHA.

Want to streamline your business processes?

  • This field is for validation purposes and should be left unchanged.

Recent Articles

  • Reading more then 10K records in D3FOE OData API

    11 July’ 2018

    Introduction: We all know Dynamics 365 Finance and Operations has limitation of 10K records to be fetched at a time usi...

    Read more
  • Paging in D365 Customer Engagement v9.0

    10 July’ 2018

    Introduction: The Xrm.retrieveMultipleRecords method is used to retrieve a collection of records in Dynamics 365 Custom...

    Read more
  • Set up Dynamics 365 connection in Microsoft Social Engagement

    10 July’ 2018

    Introduction: This blog explains how to Set up Dynamics 365 connection in Microsoft Social Engagement. Steps to be follo...

    Read more
  • Voice of the Customer failed to install

    10 July’ 2018

    Introduction: Many people face issues in installing Voice of Customer solution on v9 environment and trying repeatedly ...

    Read more
  • Scribe Insight AX as a Web Service Find Block issue

    10 July’ 2018

    Introduction: If we need to look up for any value from AX then we do it by using a Find Block in Scribe Insight Eg: Basi...

    Read more