Workflow Custom Cancel Error Message!

Adding custom Cancel Error message to your workflows

Dynamics 365 CRM allow using the workflows and the easy functionality to validate and create logic for your business process, but when creating validation error or warning messages the only way to do this with workflows is to use the stop the workflow function or custom action, the action will enable providing a message, to show and display to the end user.

The following is the typical representation of the Stop Workflow Cancel Error Message

Workflow cancel Error message
Workflow Cancel Error Message default

But the message and the system out of the box representation loses focus and will need a lot of attention to understand what the message was intended.

I was playing on how to have a better display of the error message and encounter the following tips to share:

  1. How to Add line brakes on the message
    1. You can add line brakes using the following combination of special character within your message “\r\n”, at the end of the line you want to present as part of the error message
  2. How to Include Bold or different size font for the message
    1. You can change the font size using the HTML tags for Headers like H1, H2, H3
    2. The workflow error message is injected to a Span tag on the form, so you will use any of the HTML components that the Span tag will allow


The following is a sample screen shot with the changes on the message:

“<h2>FOUND THE TASK EXHIBIT</h2> \r\n Detail Message for the Error! \r\n”

Updated Workflow Cancel Error Message
Updated Workflow Cancel Error Message

hope you enjoy the tips!


Stop Pop up for “”

It seems that with the new Dynamics 365 CRM Online, there is been a pop up coming so often with the following URL “”, the pop up keeps coming every few minutes and was really annoying to the point to investigate the source of this issue.

The pop up was related to the Learning Path functionality. To resolve the pop-up behavior you will need to open CRM Online and on the Options cog on the top right, and select the “Opt out of Learning Path” and then that pop up will stop.

The following screen shot will guide you the location for Opting out of the Learning Path functionality.

Learning Path PopUp Issues
Learning Path Pop Up Issues

That resolved for me! Hope will help you resolve the pop ups for you.


How to update CRM 2015 form field background color?

Why my code is not working in MS Dynamics CRM 2015 Update 1?

The past month we got a request to help migrate a customer from CRM 2011 to CRM 2015 Update 1, when working on the upgrade we encounter some custom code and particular dynamically form field color  changes using JavaScript, the code was correctly working on the previous version but when in the new upgraded version the solution stop working.

I notice when using IE Developer Tools the element Id was there but the JavaScript code always returns NULL value and the script was generating pop-up errors. I was looking for some issues on the javascript, used several ways to get to the element using JQuery and other 3rd party libraries, with no success.

In my effort to find a solution i review what was new on the new version CRM 2015 Update 1 (SDK 7.1) and find out that we have a new form rendering engine that was build for better performance and also  change the way manage javascript and 3rd party libraries.

The details for the rendering are located in the following link:

New Form Rendering Engine

Things that the new form rendering engine will break:

  • Any attempt to access DOM in the content iframe using JS, jQuery or other 3rd party libraries (document.getElementById() or jQuery selectors)
  • Creating a new HTML content in the parent window for persistent content (and assumed that the parent window was the main CRM iframe.
  • Window.load, parsing iframe/form URL
  • Attempting to use unsupported (non-XRM) APIs, especially undocumented ones that may have been shipped with CRM for internal usage only
  • Accessing window.parent() from a web resource that may assume for example there’s a variable set in the current window context.


But how I can fix the issue with dynamically update Form Fields colors?

The details on the New Form Rendering Engine have a Fallback options, that will allow the old Form Rendering Engine to work with your code.

To use the old Form Rendering Engine you will need to update the System Settings in CRM.

Navigate to Settings -> Administration -> System Settings -> General

At the bottom of the form select “YES” under “Use legacy form rendering” and click OK button to save.

The next step will be to close your IE session and clear the cache on your browser.



Your code will continue working the same way in previous versions.

   //// Update Field Label Colors
   document.getElementById("new_numbervalue_c").style.color = "White";
   document.getElementById("new_numbervalue_c").style.backgroundColor = "#66CDAA";

   //// Update Field Input Colors
   document.getElementById("new_numbervalue_i").style.color = "White";
   document.getElementById("new_numbervalue_i").style.backgroundColor = "Red";

Hope this will help you understand the form rendering updates and new features in Microsoft Dynamics CRM 2015 Update 1 (SDK 7.1).

SOAPUI can’t load MS Dynamics CRM 2015 wsdl

SOAP UI and Microsoft Dynamics CRM 2015 have a lot new features and functionality, but when I was importing Microsoft Dynamics CRM WSDL in SOAP UI  keep giving me errors on the tool, and can’t  load the WSDL that microsoft dynamics CRM Organization service page provide.

Keep getting the following error messages:

Error: type ‘DateTimeBehavior@’ not found

Error: type ‘ArrayOfEntityKeyMetadata@’ not found

Error: type ‘KeyAttributeCollection@’ not found

The issues are related to the SDK Version for the WSDL, and the correct response from the Organization Service.

You need to specify the SDKVersion=7.1 and to get the full list for the WSDL with the value WSDL=wsdl0

The correct and full URL for the organization service that SOAP UI will be able to load is the following:

After adding those parameters to the url, SOAPUI will load all the missing or not found metadata elements and definitions, now you can create test connections .

Have fun with the new features in SOAP UI and Microsoft Dynamics CRM 2015.

Please leave your comments or questions regarding SOAP UI and CRM 2015.

CRMBuzz Power Tools Module Installation

The framework designed and developed for integration and connecting PowerShell automation and flexibility to Microsoft Dynamics CRM 2013/2015

The installation is been one of the most common questions on the use of the framework, these are step by step instructions on how to install and use the PowerShell tool.


        1. Open PowerShell
        2. type the following command, to let PowerShell use the most updated .Net framework version (required .Net 4.5.2)

          Reg Add HKLM\Software\Microsoft\.NetFramework /v OnlyUseLatestCLR /t REG_DWORD /d 1

          Reg Add HKLM\Software\wow6432node\Microsoft\.NetFramework /v OnlyUseLatestCLR /t REG_DWORD /d 1

        3. Unzip the zip file and create a folder where you will put the binaries, we will use by default the following c:\PowerShell\CRMBuzz
          Md PowerShell
          cd PowerShell
          Md CRMBuzz
          cd CRMBuzz
        4. after unzipping the file and adding the files on the default folder, we will need to add 2 of the files to the GAC, using the following command.\gacutil.exe .\microsoft.crm.sdk.proxy.dll
          .\gacutil.exe .\microsoft.xrm.sdk.dll
        5. Close the PowerShell session, the next time you open a new PowerShell session will have these setting integrated.

Open a new PowerShell session and now you can use the following command to use the module

Import-Module .\CRMBuzz.PowerTools.PSSnapin.dll -Force -WarningAction SilentlyContinue -DisableNameChecking

To validate that the module is available to use, you can validate using the following command

Get-Command -pssnapin CRMBuzz.PowerTools.PSSnapin

Next blog post will have more information on the individual cmdlets included in the framework and how to used, also information on scripts the command is included.

please send your commends or questions.

Download the framework from the CRMBuzz PowerTools Codeplex location and also find the most updated in Github folder

Get the most updated Documentation Github CRMBuzz PowerTools Wiki


Enable Form Notifications

The question was asked!, how can I enable the Form Notifications on Microsoft Dynamics CRM 2013.
The notification section is not available on all the forms, like custom entity forms, and I want to add notifications to those forms with other validation on fields events.

using the browser developer tools on the forms where the notification is available, i found the following element “crmNotifications” that will display the notification and show the message

// Enable Form Notifications

function Notifications() {

    var crmNotificationsDiv = document.getElementById("crmNotifications"); = "block";

    Xrm.Page.ui.setFormNotification('Notifications Error', 'ERROR', '1');
    Xrm.Page.ui.setFormNotification('Notifications Warning', 'WARNING', '2');
    Xrm.Page.ui.setFormNotification('Notifications Info', 'INFO', '3');
    alert('Completed Notification!');

function NotificationMsg(FieldName, Msg, TypeMsg, MsgId) {
    var crmNotificationsDiv = document.getElementById("crmNotifications"); = "block";

    Xrm.Page.ui.setFormNotification(Msg, TypeMsg, MsgId);
    Xrm.Page.ui.setFormNotification(Msg, TypeMsg, '2');
    Xrm.Page.ui.setFormNotification(Msg, TypeMsg, '3');

function clearNotifications(FieldName, MsgId) {


    var crmNotificationsDiv = document.getElementById("crmNotifications"); = "none";

The code will help you to add a message on a single line or the same message on all 3 lines, also you can assign the message to a specific field, the clearNotifications as the function indicates will clear all the messages on the notifications section.

I been using the following functionality, with my custom entity forms and it works fine, a little more work need to be implemented but that will be implemented in the near future.

hope you can use the following code!, and also please remember that the code is unsupported and can stop working with the coming roll up or Service packs updates.

Contact us for a free consultation if you have any further questions.

Abe Saldana.


IE Clear Cache using Command Prompt

Working on a solution where i need to do alot of changes and validate that the changes are working correclty, i was clearing the cache manually going to the Internet Explorer and then using Tools > Internet Options and then under the Browsing History click on the Delete button, that was extremely tedious and it was taking a little more time that i want it to be.

looking to resolve the clicking and using a script i research on how to Clear the Cache using the command prompt, and found the following scripts that you can run

255 Deletes All History
  1 Deletes History Only
  2 Deletes Cookies Only
  8 Deletes Temporary Internet Files Only
 16 Deletes Form DAta Only
 32 Deletes Password History Only

4351 Deletes All Previous

rundll32.exe InetCpl.cpl,ClearMyTracksByProcess 255
rundll32.exe InetCpl.cpl,ClearMyTracksByProcess 1
rundll32.exe InetCpl.cpl,ClearMyTracksByProcess 2
rundll32.exe InetCpl.cpl,ClearMyTracksByProcess 8
rundll32.exe InetCpl.cpl,ClearMyTracksByProcess 16
rundll32.exe InetCpl.cpl,ClearMyTracksByProcess 32

rundll32.exe InetCpl.cpl,ClearMyTracksByProcess 4351

i have them in a batch file and just run the batch file when I need to clear the cache.




Using SoapUI 5.0.0 to Test CRM 2013 Organization Services

Working with integration projects, I have to come up with a way to test the Soap messages the BizTalk group was generating to interact with CRM 2013, and found the following tool SoapUI Version
The tool is extremely flexible and configurable; you will need to create the 3 headers that will be included when using Client side code.



Accept: application/xml, text/xml, */*

Content-type: text/xml


The Authentication used for my test was NTLM using an OnPrem organization, where I need to add the User, Domain and Password.

The CRM Organization Service URL, was one that was a little different than the biztalk and other integration tools. for SoapUI I need to add the “/web” at the end of the Organziation Service URL (emulatin a client side connection)


SoapUI 5.0.0


Press the  play button and yiou will get the connection information and the response.

Hope this will help with your integration test.



How to Hide a Ribbon Button

Working on Contact customizations i encounter that the customer do not want to allow the users to click the button New, and only the System Administrators have the capability to Create new records.

They business need was that the integration application will bring the new records from an external application and the users will be able to read and append information, but not to create, I also created a Security Role for that, but researching i found that also can be done in client side.


// Hide a Ribbon Button
var btnNewRecord = top.document.getElementById("incident|NoRelationship|Form|Mscrm.Form.incident.NewRecord"); = 'none';


The 3rd option was to create a copy of the form an only allow the System Administrators to have access to the New button.

So there are many different ways for a solution, it depends what is the best for your business request.





How to replace Lookup empty Name, with different field value

I just started working with a new customer and we already have some interesting challenges, some of the bulk import data, have most of the Contact Entity records empty except with on field that was an representation from other system called the Customer Number.

Well when CRM displays the Contact information is really nothing, just have the 5000+ records count and nothing on the screen, well I fixed that adding the Customer Number to the Views, but then another issue, in a relation with other entity the Contact relays in the Full name to display as part of the Lookup field, but there is no Full name on the record and can’t be clicked to take you back to the Contact record.

The solution is to have client side code that will run on the Onload event of the form, get the current Lookup information, make a request to get the Contact record information using oData, and reassign the Lookup Name value with other field on the Contact Entity.

The following is the code used to accomplish the solution on the related entity. You need to add the function “changeCustomerLookup()” to the form onload event.
Also you will need the following Files to be included in your form libraries:

  •  abe_jason2.js
  • abe_SDK.REST.js
  • abe_SDK.JQuery.js


function changeCustomerLookUp() {

var ExistingContact ="abe_contact");
    if (ExistingContact.getValue() != null) {
        var ExistingGUID = ExistingContact.getValue()[0].id;
        var _ToEntity = "Contact";
        SDK.REST.retrieveRecord(ExistingGUID, _ToEntity, "*", null,
        function (result) {
            if (result.LastName == null) {

                var ExistingName = result.abe_customernumber;

     SetLookupValue("abe_contact", ExistingGUID, ExistingName, "contact");


        }, function (error) { alert('Contact Error:' + error.message) });


function SetLookupValue(fieldName, id, name, entityType) {
    if (fieldName != null) {
        var lookupValue = new Array();
        lookupValue[0] = new Object();
        lookupValue[0].id = id;
        lookupValue[0].name = name;
        lookupValue[0].entityType = entityType;

Downlod the Client side code here: abe_LookupEdit.js Download

enjoy the code, please leave your comments and recomendations


Abe Saldana