Adding Knowledge article in custom entity side panel

There could be a requirement to assist users with knowledge when there are no apps – sales, voice of customer etc installed in the instance. In this case, we will have to enable users access to published knowledge articles.

To achieve the above requirement is quite easy, we will make use of the Xrm.App.sidePanes.getPane APi. First, let’s describe the scenario, we have a custom table and would like to expose the article to users via a side panel. The side panel will be an existing entity record.

Continue reading “Adding Knowledge article in custom entity side panel”

Desrialize and Serialize Json in plugin without newtonsoft library

Often developers struggle with how to handle Json in Plugins, this blog is a way how to serialize and deserialize JSON in plugins without using Imerge or using the new plugin package. Using the method which involves only C# and the default system library, developers can easily serialise and deserialize JSON data.

In the example below, I have created a class that takes a generic T class and then using memory stream to read its value;

Continue reading “Desrialize and Serialize Json in plugin without newtonsoft library”

“Undeclared Property Error” in assigning lookup field when using web API Dynamics 365

I was trying to use the Xrm.WebApi.createRecord d365 API to create a record but was getting the error :

“An error occurred while validating input parameters: Microsoft.OData.ODataException: An undeclared property ‘YOUR FIELD’ 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.”

This error seems to be a common error and the solution could be found everywhere online but in my case, the solutions like this still could not resolve the issue. After much debugging and trying several things, the solution below worked for me:

Continue reading ““Undeclared Property Error” in assigning lookup field when using web API Dynamics 365”

How to stop plugins from executing programmatically

You might have a situation where you would need to create or migrate records to dynamics using a console app or using any other platforms programmatically, and you don’t want to trigger plugins associated with the targeted entity. In this post, we would see as such a requirement can be met;

Here, I have created the below plugin and registered it to trigger on post Operation of entity Create, in this case, Account entity.

Continue reading “How to stop plugins from executing programmatically”

Multiselect entities in a lookup control using Xrm.Utility.lookupObjects()

You can get the requirement to lookup multiple entities and do something with the selected lookup values. Well search no more, the Xrm.Utility.lookupObjects() Api method would meet such requirement .

I have loaded the below code to trigger on the change of a field. The lookup entities in the below is Contact and Account (it could be a custom field).

Continue reading “Multiselect entities in a lookup control using Xrm.Utility.lookupObjects()”