Unable to export the solution after installing Dynamics 365 Update 2 on Dynamics CRM 2016 On-Premise


  • To investigate this issue enable the tracing on the CRM Server
  • To enable Tracing Click Here
  • After enabling the Tracing. Follow the steps below.
  1. When you try to export the Default Solution if following error occurs
  2. 20
  3. Once you get the error, close it and come back to the CRM Server
  4. Navigate to C:\Program Files\Microsoft Dynamics CRM\Trace and Find the following file.
  5. 16
  6. Open and find the error caused for Export failure
  7. If you find the following exception “Workflow export: FAILURE, workflow id {919e14d1-6489-4852-abd0-a63a6ecaac5d} name Lead to Opportunity Sales Process: System.NullReferenceException: Object reference not set to an instance of an object.
  8. Open the SQL Server Management Studio
  9. Navigate to the Organization Database e.g. Org_MSCRM
  10. Navigate to Views à FilteredWorkflow
  11. Right click on Filtered View and click on “Select Top 1000 Rows”
  12. 17
  13. If you find NULL value in “businessprocesstype” for “Business Process Flow” (categoryname)
  14. 18
  15. Now select the FilteredWorkflow and click “Edit Top 200 Rows” and update the “businessprocesstype” from NULL to 0.
  16. 19
  17. Now Try to export. It should be Successful. 🙂
Advertisements
Posted in CRM, Dynamics 365, Ms Dynamics CRM 2013, MS Dynamics CRM 2015, MS Dynamics CRM 2016 | Tagged , , , , , , , , , , , , , , , , , , , , , , | Leave a comment

Enable Tracing for Dynamics CRM On-Premise


How to enable the Tracing for Dynamics CRM?

  1. Open the CRM Server
  2. Open regedit

12

3. Navigate to HKEY_LOCAL_MACHINE à SOFTWARE àMicrosoftà MSCRM

4. Right Click on MSCRM, click “New” and Select DWORD (32-bit) Value

13

5. Provide the Following

a. Value Name as “TraceEnabled”

b. Value data as 1

14

  1. Restart the CRM Server
  2. Check the location on the server “C:\Program Files\Microsoft Dynamics CRM\Trace”. You will find the Trace files
  3. If you want to disable the Tracing Provide the Value data as 0

15

Enjoy the Troubleshooting!!!! J

Posted in CRM, Dynamics 365, Ms Dynamics CRM 2013, MS Dynamics CRM 2015, MS Dynamics CRM 2016 | Tagged , , , , , , , , , , , , | 2 Comments

Plugin: Validate before Sending Email


To Validate the Email Message before sending email, then we can create the Plugin on “Send” Message.

For Email Send Plugin, We will not get the key “Target” in Input Parameters instead we will get the “EmailId” which is GUID of the email record. In order to get all the attributes of the email, you can register the Pre-Image.

if (context.InputParameters.Contains(“EmailId”) && context.InputParameters[“EmailId”] != null)

{

var emailId = (Guid)context.InputParameters[“EmailId”];

Entity entity = context.PreEntityImages.Contains(“preImage”) ? (Entity)context.PreEntityImages[“preImage”] : null;

if (entity.LogicalName != Xrm.Email.EntityLogicalName)

return;

//Logic Here

}

 

Posted in MS Dynamics CRM 2016 | Leave a comment

Remove or Hide Business Process Buttons


To Hide the Business Process Buttons cannot be done OOB.

To achieve this add a HTML Web Resource on Form and paste the following code. See the magic. 🙂

HTML Web Resource:

$(document).ready(function () {

// Hide Next Stage button

if (!parent.document.getElementById(“stageNavigateActionContainer”).classList.contains(“hidden”)) {                        parent.document.getElementById(“stageNavigateActionContainer”).classList.add(“hidden”);

}

// Hide Next Stage button

if (!parent.document.getElementById(“stageAdvanceActionContainer”).classList.contains(“hidden”)) {

parent.document.getElementById(“stageAdvanceActionContainer”).classList.add(“hidden”);

}

// Hide Previous Stage button

if (!parent.document.getElementById(“stageBackActionContainer”).classList.contains(“hidden”)) {

parent.document.getElementById(“stageBackActionContainer”).classList.add(“hidden”);

}

});

If you want to Hide the Complete Actions like “Set Active” then instead of specifying the what buttons to hide use below code to Hide all buttons related Business Process.

if (!parent.document.getElementById(“processActionsContainer”).classList.contains(“hidden”)) {

parent.document.getElementById(“processActionsContainer”).classList.add(“hidden”);

}

Still when you click on Stages, it will again show the buttons. To fix that on Form load attach the events Stage Selected and Stage Change to the Business Process.

function OnLoad()

{

Xrm.Page.data.process.addOnStageSelected(RefereshHTML);

Xrm.Page.data.process.addOnStageChange(RefereshHTML);

}

//To Refresh the HTML Web Resource on Form.

function RefereshHTML()

{

var webRControl = Xrm.Page.ui.controls.get(<WebResourceName>);

var webResource = webRControl.getSrc();

var position = webResource.lastIndexOf(‘?’);

if (position!= -1)

webResource = webResource.substring(0, position);

else

webResource = webResource + “?”;

webRControl.setSrc(webResource);

}

 

Posted in CRM, HTML, Java Script, JavaScript, MS Dynamics CRM 2015, MS Dynamics CRM 2016 | Tagged , , , , , , , , , , , , , , , , , , | Leave a comment

Remove Optionset Values from the Optionset


By using following script we can remove the options of Optionset.

var optionSetControl = Xrm.Page.getControl(<Control ID>);
if (optionSetControl != null || optionSetControl != undefined) {
optionSetControl.removeOption(1);
}

Posted in CRM, MS Dynamics CRM 2016 | Tagged , , , | Leave a comment

MS CRM 2016: Refresh the Sub-Grid on Dashboard from HTML Web Resource


How to refresh the sub-grid on Dashboard from the HTML Webresource?

parent.document.getElementById(<Subgrid control ID>).control.refresh();

e.g. parent.document.getElementById(“Component21226322”).control.refresh();

Posted in CRM, MS Dynamics CRM 2016 | Tagged , , , , , , , , , | 1 Comment