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 … Continue reading Property ‘field’ on type ‘Microsoft.Dynamics.CRM.entity’ is not a navigation property or complex property. Only navigation properties can be expanded

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 = … Continue reading Dynamics 365 Web Api – How to Set Lookup Field Value

Dynamics 365 – Input and Output Parameters of Custom Actions

Actions in Dynamics 365 are a type of process that used to extend the functionality of Dynamics 365. You can invoke actions through a workflow, plugin, Javascript or API. We can pass the Input parameters to the custom Action and the results can be set as Output parameters. C# Code of Reading Input Parameters and … Continue reading Dynamics 365 – Input and Output Parameters of Custom Actions

Dynamics 365 – Make the Form Readonly with Javascript

To make the form read-only in Dynamics 365 you have 2 options. Either changing record status to Inactive or making all form fields disabled with Javascript. Changing record status to Inactive might not suitable for some business cases. For example you might want to make your form read-only based on an attribute. If you change … Continue reading Dynamics 365 – Make the Form Readonly with Javascript

Dynamics 365 – Execute Custom Action From Javascript with Input and Output Parameters

In Dynamics 365, you can call an action directly from JavaScript with its inputs. This can be achieved using the WebAPI. First, let’s create a new custom action in Dynamics 365. Our action will accept RecordURL, Prefix, FieldsToIgnore parameters. Then it will create a copy of the Record by querying its metadata. RecordURL – Input stringPrefix– … Continue reading Dynamics 365 – Execute Custom Action From Javascript with Input and Output Parameters

Dynamics 365 – Copy/Clone a Record with Custom Workflow Activity

By using below code, you can copy a record dynamically by using its URL property. You can execute this workflow activity from Javascript with WEB API or you can execute it inside of an Workflow and implement to any required business logic easily. All you have to do is create a new custom Workflow Activity … Continue reading Dynamics 365 – Copy/Clone a Record with Custom Workflow Activity

Dynamics 365 Workflow Activity- Add Selected Users To a Team as a Bulk(AddMembersTeamRequest)

Whether you are Developer, Analyst or Consultant, there may be requirements for to add multiple users to a team. For instance, the company has created a couple of new teams in its organization chart and want you to implement this new teams to Dynamics 365. Do you prefer navigating through 20 User records by hand … Continue reading Dynamics 365 Workflow Activity- Add Selected Users To a Team as a Bulk(AddMembersTeamRequest)

Dynamics 365 – Hide/Show Custom Ribbon Button by Ribbon Workbench

If you have a custom ribbon button and you want to hide/show it by a condition, this is what you need to do; Open Ribbon Workbench and navigate to your button Select Command of your button. Under Command properties scroll down to Enable Rules. Click "Add Enable Rule" button. Select "Add New Enable Rule" to … Continue reading Dynamics 365 – Hide/Show Custom Ribbon Button by Ribbon Workbench

How to Set Lookup Field Value Using JavaScript -Dynamics 365

To set a lookup field value, you need 3 parameters. Id of the lookup recordname of the lookup recordentity name of the lookup entity Here is how to use these values to set an account lookup field. var lookupValue = new Array();lookupValue[0] = new Object();lookupValue[0].id = myAccountId;lookupValue[0].name = myAccountName;lookupValue[0].entityType = "account";Xrm.Page.getAttribute("mylookupfield").setValue(lookupValue);