CRM tip: How to Publish Multiple Products from CRM UI

Problem Statement:

In CRM, most organizations generally import products from other Source through Excel or other data import means. In general, we do not want to publish the product as soon as they are created because we need to set the price list and units before they are available anywhere in CRM.

If there are many products, CRM does not allow to publish all the products at once. It becomes very painful to publish each and every product.

This is unimaginable if the count is in thousands and more.

See screenshot below which suggests I cannot see the Publish option if I select more than 2 products in the view:



The best way to tackle this is:

  1. Create a Default Product Family (Dummy product family).
  2. Add all the products in the Dummy product Family. You can do this while importing products as well by setting the parent product as the Default Product Family.
  3. In case you already have a family and hierarchy, you can still follow this approach by setting the parent of root family as the Default Product Family.

E.g. If you have products as the following defined hierarchy:

  1. Product Family A
    1. A1
    2. A2
  • A3
    1. A31
    2. A32
  1. Product Family B
    1. B1
    2. B2

In this case, you can set the parent of “Product Family A” as Default Product Family


  1. Once this is done, you can now import all the products, set up pricing and units as required.
  2. This is how your Hierarchy will look like in CRM:Pic25062017_2
  3. When all the products are ready, go to the Default Product Family A
  4. On the ribbon, Select Publish –> Publish HierarchyPic25062017_3
  5. This will publish all the products in the hierarchy. Since all your products are in the hierarchy of the “Default Product Family”, all the products will be published saving A LOT of Time.


Please post your comments below if you have any queries!!

XRMToolBox – Important tools for Admins and Developers

What is XRMToolbox

XrmToolBox is a Windows application that connects to Microsoft Dynamics CRM, providing tools to ease customization and configuration tasks. It is shipped with more than 30 plugins to make administration, customization or configuration tasks easier and less time consuming.

XRMToolBox is free of cost, but you can donate to support development.

In this blog, I will list down the top 5 tools from XRM toolbox for both developers and CRM Administrators.

How to Use it

Documentation is available through the wiki of XrmToolBox Github’s repository. You will find information about prerequisites, a list of known existing plugins, help on how to connect to your Microsoft Dynamics CRM deployment, and much much more..

Top Tools of XRMToolbox for Developers

1.      WebResources Manager

Author- MscrmTools

Description – Manage your webresources easily. This tool has saved me hours of time for creating, updating and managing the web resources for Dynamics CRM. This is a must have for all the Developers


2.      SiteMap Editor

Author – MscrmTools

Description – Manage the SiteMap with no XML edition. Editing Sitemap XML is scary for any developer as any mistake in XML can make the Entire CRM unusable.

This tool helps to edit your sitemap components. You can easily create areas and subareas, update the order and copy/ paste components from one area to another. You can also update all the sub area details like icon, titles for multiple languages etc.


3.      Ribbon Workbench 2016

Author – Scott Durow

Description – Edit the Dynamics CRM Ribbon or Command Bar from inside the XrmToolbox.

By installing the Ribbon Workbench you’ll quickly be performing customisations that were previously only possible by time consuming and error-prone manual editing of RibbonDiff Xml.

Learn More –

4.      FetchXML Builder

Author – Jonas Rapp

Description – The tool will assist in three major areas:

  1. Constructing FetchXML in ways that Advanced Find cannot – aggregates – outer joins – “has no”-queries – attributes from multi-level linked entities
  2. Querying CRM for information not (easily) found in the CRM UI – system / internal entities – attributes hidden in CRM UI – join on other fields than relationships
  3. Developer assistance – Generate C# QueryExpression code from fetch xml – Generate OData query string from fetch xml – Easy to use UI to compose queries for reports in CRM The tool reads metadata from CRM to assist with selecting entities, attributes, relations and to perform validation of condition values. To make it more appealing, there is also the possibility to have it show “Friendly names”, which will replace the technical names of entities and attributes with their display names in the users’ currently selected language, much like Advanced Find does.

5.      Metadata Document Generator

Author – MscrmTools

Description – A tool to generate excel and word document with entities and attributes information. You’ll no longer have to write “by hand” these awful tables full of metadata information.

Top Tools of XRM toolbox for Developers

1.      Your User Security – Magnified

Author – NORRIQ Belgium

Description – Provides a detailed overview of a specified System User’s security. Very helpful to identify the exact permission a user has on entity based on all the roles assigned to him

2.      Form related tools

Author – MscrmTools

Description – Set of tools for XrmToolBox regarding form management4

3.      Solution Components Mover

Author – MscrmTools

Description – Transfer solution components across solutions. Again a big time saver for moving components from one solution to another.

4.      User Settings and Utility

Author – MscrmTools

Description – Manage and update All user’s personal settings in Bulk

5.      Attribute Usage Inspector

Author – MscrmTools

Description – Inspects the usage of attributes per entity. Admins can review which attributes are not used across all entities and which are used most.

Create Attachment of Signature/ Pen control data in Dynamics CRM


We already saw how to use Pen/ Signature control in Dynamics CRM in the previous blog:

In this blog, we will see how to generate an image of the pen control data and store in Record as an attachment.


  • As we saw in the previous blog, the signature captured from phone is stored as a multi-line text field in Dynamics CRM record. And we cannot see the signature image in web browser.



Now it will be a common scenario where the Users will need to see the Signature image in browser as well. This is how data is captured on Web browser.

  • We need to write custom code which will:
    • Read this data
    • Convert the data to an image
    • Store the converted image as an attachment in the CRM record
  • For this I, have written a generic plugin which will do the above actions.
  • You can see the core plugin code with comments below. I have also added the plugin to Github for reference: Github Link


//// The plugin is registered on the Post Update on "Customer Approval" field on Opportunity.

Entity entity = (Entity)context.InputParameters["Target"];

  //// The field which stores the data for Signature
  string signatureFieldName = "new_customerapproval";

  if (entity.Contains(signatureFieldName))
      string encodedData = entity.GetAttributeValue<string>(signatureFieldName);

      //// Remove the additional Metadata from the text generated.
      int startIndex = encodedData.IndexOf("base64,") + 7;
      encodedData = encodedData.Substring(startIndex, encodedData.Length - startIndex);

      string contentType = "image/png";
      Entity Annotation = new Entity("annotation");
      Annotation.Attributes["objectid"] = new EntityReference(entity.LogicalName, entity.Id);
      Annotation.Attributes["objecttypecode"] = entity.LogicalName;
      Annotation.Attributes["subject"] = "Customer Signature"; //// You can have any subject as required.
      Annotation.Attributes["documentbody"] = encodedData;
      Annotation.Attributes["mimetype"] = contentType;
      Annotation.Attributes["notetext"] = "Customer Signature Attached"; //// Again, add any note text as needed
      Annotation.Attributes["filename"] = "Customer Approval Signature.png"; //// OR Any name as required

      Guid annotation = service.Create(Annotation);



  • This plugin should be registered on update of the Signature control field. In this case, it is “Customer Approval”. It is preferable to have the step run asynchronously.
  • We can now see the attachment on the record.




If you have any issues or need more information, please post in the comments section below.

Adding Signature control on Mobile and Tablets in Dynamics CRM


With CRM 2016, Dynamics added controls which can be used in Phones, tablets and some on web forms as well. One such important control is the signature control in Dynamics CRM.

This control is available for Phones and tablets, and very important in the modern sales process.

In this blog, we will see how to add Signature control on Mobile and Tablet forms.



  1. Create a Multi-line text field with minimum length greater than or equal to 15000. Let’s say the name of the field is “Customer Approval”


  1. Add the Customer Approval field to CRM form.
  2. Add the Pen Control on the Customer Approval field.


  1. Once you publish, you can now see this control on your Mobile and Tablet application. It will look like below. Note: You also need to select the check box below the signature for the app to save the data.


Once Customer/ Person signs using the above, the information is stored back in CRM.


Other Information:

  1. The control cannot be used on Web forms. It will look like a Text box field. So, it is advisable to have this field locked or hidden on Web.
  2. On web form, and in CRM DB, the data is stored as the base64 format inside the field. So if you open the form on CRM, it will look like below.



  • Using controls for forms on mobile, and tablets vastly improves the user interface on handheld devices. It is important to understand controls and apply them at relevant places on CRM forms.

PS: I will be writing another blog, which will automatically convert the base64 data of the signature and store it as an attachment on the entity.

Alternatives of Document storage in Dynamics CRM


CRM space is expensive, and often clients want alternatives to CRM storage for storing documents, images as these take up most of the space.

Available solutions:

  1. SharePoint Online with Dynamics CRM
  2. OneDrive for Business with Dynamics CRM

Currently, SharePoint document management is the preferred choice for most of the customers as alternative to storing email attachments and documents.

Advantages of SharePoint:

  1. SharePoint storage cost is very small about $0.20 per GB/Month compared to CRM’s $9.99/GB/Month. So CRM space is around 50 times costlier than SharePoint space.
  2. You can leverage SharePoint Document management features like:
    1. Full text Search
    2. Metadata sorting
    3. Revisions
    4. Enterprise grade security

There are 2 ways to use SharePoint for document management with Dynamics:

  1. Use SharePoint Online Integration with Dynamics CRM. This is the ideal and efficient way to use SharePoint. You can see the steps for SharePoint online integration in one of our previous blogs:

  1. Use 3rd Party tools like Power Attachment, which will migrate your File attachments (notes) and Email attachments from CRM storage to Dynamics.

More detail and pricing about Power attachments can found here:

1st approach should be the preferred way for using SharePoint as it is free, and works well. But users complain about an extra step to navigate to attachments, in which case you can go for Approach 2.

Alternative Solution:

  • The drawback with using SharePoint is if you have requirement of migrating your documents from CRM storage (Notes Attachments and Email attachments), you need to use 3rd party paid tools like Power Attachment.
  • Developing custom plugins to migrate documents to SharePoint is difficult in CRM online, since we cannot use External libraries in Sandbox plugin.

Due to above 2 reason, we can use Azure Blob storage as a possible alternative for migrating CRM documents.

What is Azure Blob storage:

Massively-scalable object storage for unstructured data

With exabytes of capacity and massive scalability, Azure Blob storage easily and cost-effectively stores from hundreds to billions of objects, in hot or cool tiers depending on how frequently data access is needed. Store any type of unstructured data—images, videos, audio, documents and more.

Azure Blob Features:

  1. Easy to Use – Geo Redundancy
  2. Robust API access
  3. Very Cheap storage space:

It costs about $0.03/ GB/ month- which is 6.5x less than SharePoint storage cost and

300x less than CRM storage cost.

Learn more about pricing here:

API Coding for CRUD Operations in Azure Blob:

I have written a sample plugin which will migrate the CRM attachment to Azure blob, and save the Azure blob file link back in CRM. The plugin is registered on Annotation entity

For this, I have used a RestHelper and BlobHelper utility code files, which have all the operations of (a) making a web request and (b) performing blob operations.

The Helper files and the CRM plugin sample can be found in the below GitHub link:

The plugin file is UploadDocumentToBlob.cs

  1. The below code from the plugin file takes the document from CRM and creates a blob using REST API:
 Entity entity = (Entity)context.InputParameters["Target"];

                string documentBlobURL = string.Empty;

              //// Optional condition to migrate attachments related to particular entity.

                //// If you want to migrate attachments for all entities, remove this CONDITION
                if (entity.Contains("isdocument") && entity.GetAttributeValue<bool>("isdocument") == true &&

                    entity.GetAttributeValue<string>("objecttypecode") == "account")


                    string storageAccount = "<storageaccountname>";

                    string filename = entity.GetAttributeValue<string>("filename");

                    string containerName = "<blobcontainername>";

                    string storageKey = "<blobstorage_accesskey>";

                    //// Read File

                    string text = entity.GetAttributeValue<string>("documentbody");


                    BlobHelper blobHelper = new BlobHelper(storageAccount, storageKey);

                    bool isUploadSuccess = blobHelper.PutBlob(containerName, filename, text);

                    //// Once blob upload is Success, get the Azure blob download-able URL of the uploaded File

                    if (isUploadSuccess)

                        documentBlobURL = string.Format("https://{0}{1}/{2}", storageAccount,

                            containerName, filename);


Let me know your suggestions on this blog, please use the comments for suggestions/ queries.

User Adoption and Monitoring in Dynamics 365 Online (CRM)


The final phase of any Dynamics CRM implementation is to review the User monitoring closely and to ensure user uses the application.

It is important that sales people understand the benefits of using Dynamics CRM and help them use CRM for managing their work and customers/ opportunities.

With Dynamics 365, Microsoft has introduced following ways to monitor User Adoption, User Activity, Storage, Plugin Executions, API calls and failures at a single place for CRM.

Organization Insights

With Dynamics 365, Microsoft has published an app – Microsoft Dynamics 365 – Organization Insights on AppSource. System administrators can install this app to their CRM organization from AppSource for Free.

Once installed, Admin can see all the metrics inside CRM by Navigating to Settings à Organization Insights.

The Dashboard shows the following important information:

  1. Active Users
  2. Plugin Information and Execution Metrics
  3. CRM storage info by Entities

Figure 1 Organization Insights overview


Figure 2 Plugin Execution Metrics


Figure 3 CRM Storage metrics By entity

<Image source – Microsoft AppSource >

Additionally, you can also customize the dashboards and expose the Organization Insight data as well.

Learn more on technet:

Video Link:

Admin Portal Reports

Like Organization Insights, Office 365 also has User activity and usage reports within the Office 365 admin portal. Using this Administrator can identify which services are being used most, and if some services are not used, they can be deallocated or licenses can be removed.

Who can see Office 365 reports

  • Global Admins
  • Exchange Admins
  • SharePoint Admins
  • Skype for Business Admins

Reports duration can be selected as 7 days, 30 days, 90 days and 180 days. There should be data for at least 30 days for report to show any data.

Admins must navigate to Reports -> Usage in Office 365 Admin center to see the reports.


What type of reports are available?

  • Email Activity
  • Office Activations
  • Mailbox usage
  • Onedrive for Business/ SharePoint and Skype for Business activity reports

You can learn more about O365 Admin reports here:


Role Based Forms – Dynamics CRM

In this blog, we will learn how to use Role based forms in Dynamics CRM and the best practices that should be followed when using Role based forms.

What are Role Based forms

Microsoft Dynamics CRM allows configuration of security roles in Entity forms. It is quite a common requirement for organizations where they want users of two different security roles to see different fields and sections.

For ex, a Sales person would want to see only the Sales details on the form and a CEO/ Director wants more details in the form.

Also, there is a possibility that there are 2 product lines which have different set of fields for the same entity.


Alternative approaches

From the above requirements, most users will think that the above can be achieved using form customizations or JavaScript on the form.

While this is true, this approach is not a feasible one when the 2 versions of form which we create are a lot different from one another.

JavaScript should be used when there are only few fields which we need to show/ hide on the form based on Security Roles.

How to enable/ implement Role based forms

Using/ enabling security roles in forms is very straight forward, but we have to be careful to set/ remove the roles carefully for each form.

  1. I have created two contact forms as below. As you can also see, there is a button on the top of Form section “Enable Security Roles” which we will use to configure form security

Figure 1

  1. By default, both forms are accessible to all the security roles. We will now change the security roles for each of the form
  2. For “Contact Form”, we will provide access to only CEO – Business Manager, CSR Manager and Marketing Manager. So Users with roles other than these will not be able to access this form.

Figure 2

  1. And similarly I will configure the security roles for the “Contact v2” form. We will assign roles Salesperson and Marketing professional for this form.

Figure 3

So we have now created 2 forms which users with different security roles will access. But there are few OTHER things which we need to address before we complete this entire process

Things to consider

When we implement Role based forms, the following questions pop up in our mind, for which I have also mentioned the solutions

Q1. What if the User has 2 security roles and thus have access to both the forms?

A: The User will see both the forms and there is an option for user to choose one of the forms in the Top left corner. Refer screenshot below:


Figure 4

The answer to Q1 will pop up another question:

Q2. If the user has access to two forms, which form will be visible by default to the User?

A: There are 2 parts:

  1. User access the Entity form for the very first time

When a User access the entity form for the very first time, the default form which User will see will depend upon the Form Ordering. This can be checked in Entity customizations like below:

Navigate to Form Order à Main form set



Figure 5


Figure 6

  1. When User changes the Form from the Dropdown

Whenever user changes the Form from the Dropdown, CRM stores the user preference. So when the user logs in next time or navigate to the same entity form next time, CRM shows the form that the user has used previously and will ignore Form ordering for the particular user.

Q3: What if a User has access to the entity but has no Access to any of the forms for his Security Role?

A: CRM is very smart and handles this by using “Fallback” mechanism. When we configure the Security Role for a form, there is a checkbox at the bottom à “Enable Fallback”

As you can read from the Description in the screenshot, this form will be shown to the Users with roles that don’t have any forms assigned.

CRM makes it mandatory to select at least 1 form for fallback.


Figure 7

Q4: What if I don’t want to make any of my forms as Fallback forms?

A: This is a valid scenario as we don’t want the users who are not explicitly assigned any role on the form to see the form.

  • As a workaround, we can create one form as a “Default Fallback” form which will not have any form fields (or 1-2 fields) and configure this form to be a fallback form.
  • Additionally, we can add a web resource (HTML) in this form which says something like this:

“If you are seeing this form and do not have access to any other form for Contacts, Please contact Administrator.”

  • Also, we should keep the Fallback form last in the Form Order.

This is how the fallback form would look like:


Figure 8

I hope this article was helpful. Please send comments if you need any clarifications.

Happy CRMing!!!