D365: Enable Rule for button with asynchronous API request using promise

Many times, we get requirement to show/hide a button based on certain condition for which we define Enable Rule in Ribbon Workbench. If we need javaScript code for evaluation then we use Custom Enable Rule mentioning library, method to execute, passing PrimaryControl CRM parameter and additional parameters if necessary. Sometimes, the evaluation is done real … Continue reading D365: Enable Rule for button with asynchronous API request using promise

D365: "The user is not a member of the organization" error while connecting to CE

Recently, we were working on connecting to CE to do some CRUD operation using Azure function. We were using Client ID(Application ID) and Client Secret of the app registered on Azure Active Directory. We had provided the necessary API(Dynamics CRM) Permission (delegated "user_impersonation") to the app. While running the Azure function, we were getting the … Continue reading D365: "The user is not a member of the organization" error while connecting to CE

D365: The webhook call failed because the http request received non-success httpStatus code

Recently, while trying to invoke webhook using custom global action we got an error saying "The webhook call failed because the http request received non-success httpStatus code. Please check your webhook request handler." We were using JS to call a custom global action which was used to invoke webhook which in turn was used to … Continue reading D365: The webhook call failed because the http request received non-success httpStatus code

D365: Azure Durable Function with D365 CE – Part 3

In the previous post, we saw how we can implement durable function for CRUD operation in D365 and test it using Postman. In this post we'll see how we can parameterize durable function so that we can pass parameters from external system to durable function and process it further. Let's take a simple example as … Continue reading D365: Azure Durable Function with D365 CE – Part 3

D365: Azure Durable Function with D365 CE – Part 2

In the previous post, we saw how we created the default template of durable function. In this post, we'll modify that to do some CRUD operation in D365 CE. For demo purpose, let's pick a simple scenario i.e. Retrieve related records(accommodation payments) of a particular Contact record and update their field(Expected Refund Due Date a … Continue reading D365: Azure Durable Function with D365 CE – Part 2

D365: Azure Durable Function with D365 CE – Part 1

In this series of post, we'll see how we can use Azure Durable function(an extension of Azure Function which works on durable task framework) with D365 CE. We can find more details about Durable functions, it's application patterns, pricing and the way it works here: https://docs.microsoft.com/en-us/azure/azure-functions/durable/durable-functions-overview. This series of post is divided into 6 parts:Part … Continue reading D365: Azure Durable Function with D365 CE – Part 1

USD 4.1: Implementing Click to call functionality for making outgoing calls

In this post, we'll see how we can implement click to call functionality i.e. clicking on a phone number field on the form to make outgoing call inside USD. NOTE: In our scenario, we have implemented custom CTI adapter to use web services of telephony provider to make the outgoing calls. Below are the steps … Continue reading USD 4.1: Implementing Click to call functionality for making outgoing calls

USD 4.1: Using CTI Simulator and Generic Listener

In this post, we'll see how we can use CTI simulator along with Generic Listener provided by Microsoft. To start, download the CTI simulator from the following location: https://onedrive.live.com/?authkey=%21AIN2jgKztrYGpok&cid=5A34CCE9728C8F4F&id=5A34CCE9728C8F4F%21274&parId=5A34CCE9728C8F4F%21169&action=locate. Unzip it. Open the solution file in Visual Studio and compile it. Open the Project folder. Navigate to bin--> Debug folder and locate the USDCTICallTester.exe as … Continue reading USD 4.1: Using CTI Simulator and Generic Listener

D365: ExecuteMultiple error EntityState must be set to null, Created (for Create message) or Changed (for Update message)

While working on bulk update recently, we got an error saying "EntityState must be set to null, Created (for Create message) or Changed (for Update message)" in the ExecuteMultipleResponse object. We were trying to update one attribute of a set of records and below is the piece code we were using to do bulk update: … Continue reading D365: ExecuteMultiple error EntityState must be set to null, Created (for Create message) or Changed (for Update message)

D365: Unable to delete entity having hidden dependency(with Canvas App)

Recently, we were trying to delete one entity(not that heavily customized) as we wanted to use a different attirbute as Primary field from what being currently used, in our DEV instance.We removed all possible dependency for deleting the entity by clicking on Entity -> Show Dependencies in the solution. After removing all the dependencies, when … Continue reading D365: Unable to delete entity having hidden dependency(with Canvas App)

D365: 0x80040203 Invalid Argument error below lookup field

Recently, we were working on applying lookup filtering using JS on a custom entity form. While testing it, we got an error on each key press on the lookup field "0x80040203 Invalid Argument". We were constructing the record filter criteria based on certain condition. While debugging the code, we found that the filter criteria(FetchXML filter … Continue reading D365: 0x80040203 Invalid Argument error below lookup field

Microsoft Flow: Using data returned from N:N relationship for further action

In the previous blog, we saw how to retrieve N:N records i.e. we retrieved the related "Rate" records of a particular "Revenue Schedule Line". In this blog, we'll see how to process the data returned for further action. From our previous example, we wanted to loop through each related "Rate" record of "Revenue Schedule Line" … Continue reading Microsoft Flow: Using data returned from N:N relationship for further action

Microsoft Flow: Retrieve N:N records in D365

In this blog, we'll see how we can retrieve N:N records using Microsoft Flow. Below are the steps: Go to https://flow.microsoft.com and login. After successful login select CDS connector. For demo purpose, let's select "When record is updated" as the trigger point. Select Organisation, Entity Name and Scope as shown and click New Step. Search … Continue reading Microsoft Flow: Retrieve N:N records in D365

D365: Value cannot be null. Parameter name: attributeName

Recently, while trying to retrieve records in D365 CE using LINQ, we got the following error message "Value cannot be null. Parameter name: attributeName". There was not much information in the stack trace as well. We were using below code to get records based on certain condition from 2 entities putting join as shown below: … Continue reading D365: Value cannot be null. Parameter name: attributeName

D365: Add business day(s) to specific date considering weekends and public holidays

Recently, we got a requirement to add business days/working days to specific date considering weekends and public holidays defined in CRM system and get the next working day. Below is the workdays and working hours defined in the CRM system: Fridays and Saturdays are considered as week off. Below are the list of holidays defined … Continue reading D365: Add business day(s) to specific date considering weekends and public holidays

D365: “Setup cannot continue because there is a pending restart required. Restart the computer and then try running Setup again” Error while installing Report Authoring Extension

While installing D365 Report Authoring Extension, we faced a weird error message and setup was not complete: "Setup cannot continue because there is a pending restart required. Restart the computer and then try running Setup again". Restarting the machine several times didn't fix this issue. Browsing the log file in the path mentioned in error … Continue reading D365: “Setup cannot continue because there is a pending restart required. Restart the computer and then try running Setup again” Error while installing Report Authoring Extension

SSRS: The report parameter ‘p1’ has a DefaultValue or a ValidValue that depends on the report parameter “p2”. Forward dependencies are not valid

While working on SSRS report recently, we were using 2 parameters. One parameter was depending on the value of the other parameter. While uploading the report to D365 environment, we got below error message and report was not uploaded: "The report parameter 'p1' has a DefaultValue or a ValidValue that depends on the report parameter … Continue reading SSRS: The report parameter ‘p1’ has a DefaultValue or a ValidValue that depends on the report parameter “p2”. Forward dependencies are not valid

D365[OnPrem]: System.Net.WebPermission, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 failed

Recently, we were using Custom workflow activity in which we were calling report server(using IP address) web service for generating SSRS report. We were using this custom WF activity in one workflow as a step which was getting triggered on create of a record. While testing this functionality, we got the below error message and … Continue reading D365[OnPrem]: System.Net.WebPermission, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 failed

D365: Set ConnectionId threw an exception

Recently, we got a weird error message "Set ConnectionId threw an exception" while trying to connect to D365 server from Visual Studio using Developer Toolkit. We were using VS 2015 and D365 Developer Toolkit. It was working fine and we were able to deploy plugins/custom workflows to D365 instance successfully. However, to work on reports, … Continue reading D365: Set ConnectionId threw an exception

D365: Custom Workflow Activity Input Parameter Type doesn’t Change

Recently, we were working on a custom workflow activity which takes Whole Number as input, process it and returns a String as Output. After developing it we tested it and it was working fine. Later, we wanted to change the data type of input parameter to Decimal so that we can take care of fraction … Continue reading D365: Custom Workflow Activity Input Parameter Type doesn’t Change

D365: User with ID “GUID” does not have Write privilege for the new_bpf_ “GUID” entity

Recently, while working on qualifying Lead to Opportunity we faced a permission issue. On Downloading Log file, we found the error message "User with ID 813f0246-55a4-e811-8478-5065f38bf441 does not have Write privilege for the new_bpf_02efda044479424aa7b3c7d8ab4a0a95 entity."  To fix this issue, we gave Write Permission to the BPF with GUID 02efda044479424aa7b3c7d8ab4a0a95 in a security role under Business Process Flows … Continue reading D365: User with ID “GUID” does not have Write privilege for the new_bpf_ “GUID” entity

D365: Multiple Currency Issue in Opportunity Line Grid(Inline Edit View) on Opportunity Form

Recently, while working on qualifying lead to opportunity we faced a weird issue. We were using multiple currencies in our D365 instance AED(Base currency in our case) and Egyptian Pound. We used Egyptian Pound currency on Lead while creating. On qualifying Lead to Opportunity, we were mapping the currency of Lead to Opportunity. So, eventually, currency selected … Continue reading D365: Multiple Currency Issue in Opportunity Line Grid(Inline Edit View) on Opportunity Form

Azure: Copy Data from D365 CE to Azure SQL Database using Azure Data Factory

In this blog post, we'll see how to copy data of an entity "Contact" in D365 CE to Azure SQL Database. Let's follow the below steps to see it in action. Login to Azure portal.Create Azure SQL Database where we need to copy the data. Click Create a resource --> Databases -->  SQL Database Give … Continue reading Azure: Copy Data from D365 CE to Azure SQL Database using Azure Data Factory

Plugin on Pre-Validation Stage in Dynamics 365 CE

Plug-in on pre-validation

Nishant Rana's Weblog

Recently we had a requirement to delete the Account record without deleting the associated Contact records.

If we try deleting the account record we’d get the following message box

The relationship definition can’t be updated as well to achieve this

So, we wrote a plugin on the pre-validation stage of pre-delete event of Account, which will retrieve and loop through all the child contact records and set its parent customer field as null.

In case of pre-operation the child records were not available.

 

Another practical scenario

https://www.inogic.com/blog/2017/03/plugin-pre-validation-operation-to-show-an-error-message-as-well-as-log-the-error/

Hope it helps..

View original post

D365: Error while importing unmanaged solution “Solution patch with version x.x.x.x already exists. Updating patch is not supported.”

Recently, we were working on D365 V9 upgrade from D365 V8. We had 2 DEV instances: DEV1 on D365 V8 as backup instance for making changes which need to be moved to PROD before upgrade DEV2 on D365 V9 for doing upgrade related activities/changes We had already created a patch for the solution in DEV1 … Continue reading D365: Error while importing unmanaged solution “Solution patch with version x.x.x.x already exists. Updating patch is not supported.”

USD 4: USD Client crashing with error “multiple_matching_tokens_detected”

Recently, while working on USD 4, we encountered one weird issue. After opening USD client, we selected O365 and provided credential to login. After selecting the instance to connect, USD client was crashing. Checking the log files, at the location "C:\Users\<UserName>\AppData\Roaming\Microsoft\Microsoft Dynamics® 365 Unified Service Desk\4.0.0.993",  we found the below exception "multiple_matching_tokens_detected: The cache contains … Continue reading USD 4: USD Client crashing with error “multiple_matching_tokens_detected”

Azure: Copy Data from CSV file to D365 instance using Azure Data Factory

In this post, we'll see how to upload data in CSV file to D365 instance using Azure Data Factory. We'll need following Azure resources for this demo: Azure Data Factory Blob Storage Let's go through the below steps to see it in action: Login to Azure Portal Click on Create a resource --> Select Storage … Continue reading Azure: Copy Data from CSV file to D365 instance using Azure Data Factory

D365 V9{Upgrade}: Sharing record using Web API and custom action

In D365 V8, GrantAccessRequest message was not available for which we were using SOAP request in JavaScript to share a record with a user. As part of upgrade activities, since SOAP requests are going to be deprecated, now we have replaced our SOAP request with Web API and calling custom action from Web API as we … Continue reading D365 V9{Upgrade}: Sharing record using Web API and custom action

D365: Enable Cross Origin Requests in Internet Explorer

Recently, we had a requirement to load data from external domain in a web resource on a Phone Call form. While testing the functionality in IE 11, it was not working. Debugging the code using Developer Tools, we got the below "Access is denied" error in Console window: To fix this issue, we changed the … Continue reading D365: Enable Cross Origin Requests in Internet Explorer

D365 V9{Upgrade}: Icebreakers section on Contact Form

Recently, after upgrading our D365 V8 instance to D365 V9, we found that on Contact Form there was some discrepancy in the position of the sections. After comparing the Form Editor in both the instances(V8 and V9) we found the below differences: D365 V8: CARD DETAILS section at top right corner D365 V9: New Icebreakers section at … Continue reading D365 V9{Upgrade}: Icebreakers section on Contact Form

D365 V9{Upgrade}: Ribbon Button Enable Rule Custom JS Code gives error “Cannot read property ‘getFormContext’ of undefined”

While working on upgrade activities of D365 V9 from D365 V8, we faced one weird issue related to Enable Rule of  Ribbon button. We had one form where we were using Enable Rule for a button which was defined using custom JS code. As part of client side scripting changes related to D365 V9 upgrade, … Continue reading D365 V9{Upgrade}: Ribbon Button Enable Rule Custom JS Code gives error “Cannot read property ‘getFormContext’ of undefined”

D365 V9{Upgrade}: Error while upgrading NuGet package Microsoft.CrmSdk.XrmTooling.CoreAssembly to v9.0.2.5

Recently, while upgrading our D365 instance from V8 to V9, we had some batch jobs for integration which were running on v9.0.2.4 of CRM related NuGet packages. As part of V9 upgrade we need to upgrade those NuGet packages to v9.0.2.5. While upgrading XrmTooling.CoreAssembly to v9.0.2.5, we were getting the below error: "Unable to resolve dependencies. … Continue reading D365 V9{Upgrade}: Error while upgrading NuGet package Microsoft.CrmSdk.XrmTooling.CoreAssembly to v9.0.2.5

Azure: Web Job Deployment Error “The local data store is currently in use by another operation”

Recently, we had written a batch job to connect to D365 and do some operation on a schedule. While deploying the batch job from Visual Studio as a web job we got the below error: "The local data store is currently in use by another operation. Please wait and then try your operation again. If … Continue reading Azure: Web Job Deployment Error “The local data store is currently in use by another operation”