Integration with Dynamics 365 CE and Azure Service Bus

Integration with Dynamics 365 CE and Azure Service Bus using Topics (Publisher/Subscriber Pattern)

Last year and the beginning of this year I have been participating and presenting different interesting topics for several different User Groups, also my company and other customers requested that I presented the same content and it’s interesting the response and the request to present the same information.

This topic started a few years ago when someone requested to implement and integrate with Azure and Dynamics CRM 2015, the initial presentation had a lot more complexity and the demos took a lot of time to complete, due to the authentication with Azure was implemented as ACS ( Access Control Services) and it was to complex to create the profile and the rules that will allow the integration. Dynamics 2016 and Dynamics 365 CE has changed the way to connect and authenticate with Azure using the SAS (Shared Access Signature) this updated authentication allow to configure and create the Service EndPoints in a couple minutes, allowing me to do the demo in a range of 30 mins, testing the connectivity and create record and send the information to Azure Service Bus Topics and Subscription using JSON messages.

Continue reading “Integration with Dynamics 365 CE and Azure Service Bus”

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

Deprecated for Dynamics CRM 2016 and Dynamics 365 v9!

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

The 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


MS CRM 2013 Entity Sub-grid constantly refreshes

MS CRM 2013 Entity Sub-grid constantly refreshes

We are making some customizations to the Account, Contact and Opportunity entities and the developers are finding out that the subgrids for Contacts, Accounts an Opportunities keep refreshing (or Flashing) as we called now.

I when and look for the cause and how to eliminate the flashing on the sub-grids.

  • Select from the Navidation Settings
  • Select again from the navigation Solutions or Customizations
  • Click on the Main Solution we are working on or select Customize the system
  • Select the Entity tab (Account, Contact, Opportunity)
  • Click on Forms
  • Edit the main Form for the Entity in this case Account
  • Click on the Contacts sub-grid on the right column
  • On the ribbon click Change Properties
  • Under Data Source Section update the Default View and select the Active Contacts replacing the view called Active Contacts Subgrid View
  • click on the Set button to complete the propertie changes
  • Save and Close
  • Do the same for the Recent Opportunities, change the subgrid default view to another
  • when all the customization are completed then Publish All Customizations

Do not forget to refresh your internet explorer and try again.

So far I seen a lot better improvement on the form with a different subgrid default view and stop with the flashing notification.

hope this help!



Microsoft Dynamics CRM 2013 and Compatibility View

Microsoft Dynamics CRM 2013 and Compatibility View

We are working on a demo for a customer, and the lead asked me if I have done any code changes on the Opportunity OnLoad event, where i responded to no changes on the OnLoad event, after that I asked what was the issue and he just show me the following error message

MSCRM 2013 and Internet Explorer Compatibility error
MSCRM 2013 and Internet Explorer Compatibility error

I was looking at the Privacy settings that I just blogged about and was not related to that issue, also I check the settings for Internet Explorer in my case I’m using IE 10 and not the laters, so I change the Compatibility Settings and it seems that was the solution.

What are the Internet Explorer Compatibility settings and where to find them?

  • use the ALT key to get to the tool bar for IE
  • Select the Tools tab
  • Under the Tools Tab you can find the Compatibility View Settings like show in the following image
MSCRM 2013 and Internet Explorer Compatibility Settings
MSCRM 2013 and Internet Explorer Compatibility Settings
  • Click on the Compatibility View Settings
    • The following form will show to add the website


MSCRM 2013 and Internet Explorer Compatibility Settings Add
MSCRM 2013 and Internet Explorer Compatibility Settings Add
  • Click on the Add button to add the website
  • Also check the option with the message “Display all websites in Compatibility View”
  • Click on the Close button to complete the process

That seems to eliminate the issue with the Opportunity refresh behavior, however I seen some interesting behavior on other IE versions and it seems will not work for other versions like IE 11.

Hope this will help you to discipate some of the most common user distractions and support calls for the same IE behavior.

Please send me your comments and questions or other tips to eliminate some of these issues.

Original Blog Post from