D365 New Features – Editable Grid (Part 2)

Continued…

In first part of this blog, I have explained features of Editable Grid which is introduced in latest release of MS Dynamics 365. In this blog, I have explained how to configure editable grid and how it can be used.

How to configure editable grid

Read-only grid

  • By default, when you create any custom entity or any OOB entities, editable grid is not configured.
  • By default, read-only grid is shown to the users.
  • You cannot disable read-only grids on any entity. You can choose which one to show by default i.e. either read-only or editable grid.

Home grid (editable grid)

  • To enable editable grid on entity’s public views, you should add new control in entity.
  • You can enable editable grid on entity’s public views as per below steps:
    1. Go to settings > Customizations > Customize the system.
    2. Expand entities section and click on entity on which you want to enable editable grid. You will see entity’s properties.
    3. Click on Controls section.
      control-section
    4. By default, you will see below screen (if editable grid is not enabled).
      default-grid
    5. Click on Add Control
    6. Select Editable grid and click add.
      add-control
    7. You can select which grid to be shown as a default grid for an individual entity.
      select-grid
    8. Select additional settings like filtered lookup properties to filter lookup values in editable grid. Follow below steps to achieve the same:
      1. Select Editable Grid control as selected in above screenshot. You will see below options to set properties of editable home grid.
        editable-grid
      2. Click on Add Lookup (Note: It allows to filter lookup values which will be populated in editable grids lookup field. If your view does not contain any lookup field, then you won’t see anything here).
        configure-property
      3. Set the necessary options and click OK.
    9. Save the changes and publish the customization.

Sub grid (Editable Grid)

  • To enable editable grid for sub-grids, you need to add new control on entity form.
  • You can enable editable grid for sub-grid by following below steps:
    1. Open form editor of entity’s form on which you want to enable editable sub grid.
    2. Select sub grid control and click on change properties.
      change-properties
    3. Go to Controls Tab. Click on add control.
      controls-tab
    4. Rest of the steps are same as I have mentioned above for home grid.

Nested Grid

  • Nested grids are nothing but grid within grid. Nested grids are available only on Mobile & Tablets.
  • Nested grid can be enabled on Home as well as sub grids.
  • To enable nested grid, follow below steps:
    1. Follow similar steps as mentioned earlier to enable editable grid.
    2. Select Editable Grid and you will see an option to set properties for Nested Grid.
      nested-grid
    3. Click on the pencil icon and select the entity and to be shown in nested grid. Select the parent lookup field on which the related records should be fetched.
    4. Save and publish the changes.

Dashboard Grid (Editable)

  • Dashboard editable grid is available only on mobile and tablet devices.
  • Follow below steps to enable editable grid on dashboard:
    1. Open dashboard in design mode.
    2. Select component and click on Edit Component.
    3. Go to Controls Tab and Add control.
    4. Follow the same steps as mentioned above.

How to add event handlers on editable grid events

  • Adding event handlers is similar as we used to do for adding event handlers on form fields.
  • You should navigate to Events tab and follow same steps as we used to perform earlier:
    events
  • For Home grid, you should navigate to Entity’s design page.
  • For sub-grid, you should navigate to property page of sub grid.
  • For dashboard grid, you should navigate to dashboard grid’s property page.

How to use Editable Grid

  • Once grids are enabled for inline editing for home grids, you will see a new option in ribbon as ‘Show As’.
    show-as
  • If you have put Read-only grid as default grid, you can select any of the option. Read-only grid will show the old views.
  • If you select, Editable Grid, you will see below options.
    1. Group By – Users can group by columns. So, if you have option set on any entity and you want to see all records grouped by individual values of option set, you can select the same in Group By drop down.
      active-accounts
    2. Filtering the records – You can still filter the records by clicking an down arrow which is shown on each column’s right side.
      filtering-records
    3. You can click on the column to sort either in ascending/descending order.
      sorting
    4. You can drag-drop the column to see important information at the start at your convenience. Below screenshot is taken when user is dragging the Account Name column after Main Phone column.
      move-columns
    5. Saving the record – As I mentioned in earlier blog, records get saved automatically when focus is moved from the record. Also, users can explicitly save the changes by clicking save option provided on right corner of the grid.
      save-option
    6. Editing the records – The UI of editable grid is so intuitive, that users come to know whether the field is editable or locked. Also, you can easily navigate to the lookup record by clicking arrow. Refer below screenshots.
      my-view
      lookup

Some additional information

  • Editable grid also works on same security model. i.e. if user does not have write access on the record, then editable grid does not allow users to update the record.
  • Field level security works in same way in editable grid as well.

D365 New Features – Editable Grid (Part 1)

Introduction

Finally, most awaited feature has arrived in Microsoft’s Dynamics 365 business apps solution (formerly known as Dynamics CRM). Microsoft has introduced Editable grids in their latest release and new era called Dynamics 365. I am publishing this blog in 2 parts. In this part of blog, I have focused on what is Editable grid, what are its features. In next part of this blog, I will be covering how to configure the grid and how it can be used.

What is Editable grid?

Before release of D365, users needed to open the existing records to update any data in the entity. Even if users want to update single field in multiple records, they had to open the individual record and update the field and save the record. For each record, they had to repeat these steps. This approach of updating data was time consuming and irritating.

With introduction to editable grid, Microsoft has allowed users to update the records right away with all those validations which was applicable on the form.

Editable grid is nothing but a list or view of records having editing capabilities without opening the record.

Editable Grid Features

Types of grids

  1. Read-only grid – These are the same grid which users are seeing in earlier versions. The CRM entity views which do not have editing capabilities are called read-only grids in D365 release.
  2. Home grid – These are the CRM entity views having editable grid capabilities. Entity’s public views and personal views with editing capabilities are called home grid.
  3. Sub grid – This is old grid which is shown on entity form to show related records. Sub grids can also be made editable.
  4. Nested grid – This is new grid introduced in D365. Nested grids are shown when we expand any record in view itself without opening form. This grid also shows related records of expanded record from view.

Note: Nested grid is available only on Mobile and Tablets. It is not available on web client/CRM for Outlook.

  1. Dashboard grid – This is the grid which is shown on CRM dashboards.

Note: Dashboard grid is available only on Mobile and Tablets. It is not available on web client/CRM for Outlook.

Features

  1. Below types of fields have inline editable grid capabilities:
    1. Single line of text
    2. Date and Time
    3. Option Set
    4. Whole Number
    5. Decimal
    6. Floating Point Number
    7. Two Options
    8. Lookup
  2. Below types of fields are read only in editable grid:
    1. Customer
    2. Rollup Fields
    3. Calculated Fields
    4. Composite Fields
    5. Status and Status Reason Fields
  3. Business rules which are have scope at Entity level works on editable grids.

Note: Business Recommendations (introduced in this release) is not available on editable grids.

  1. Below JavaScript events are available on editable grid:
    1. On record select
    2. On save
    3. On change
  2. Users don’t have to explicitly click on save button. Records are saved automatically when focus from the record is moved.
  3. As its name suggests, only inline editing is possible and users cannot create records through inline editable grids. Users can still use quick create form to quickly create the records.
  4. Below grid functionality is available for editable grids:
    1. Sorting
    2. Searching
    3. Grouping
    4. Filtering
    5. Pagination
    6. Column resizing
    7. Column movement by simply drag and drop capabilities
  5. It also saves user state within the session. So, if user does any settings like column resizing, column movement on active accounts view, and if user navigates to any other entity, then when user comes back to the active accounts view within the same session, it shows the same settings.
  6. The editable grid is nothing but an additional control and can be exported through a solution and imported back into target environment as a solution.

Understanding Dynamics 365 Online Instance Management

What is covered in this blog?

Recently, I have received many queries and confusing questions from clients/CRM technical people around managing Dynamics 365 Online (formerly known as CRM Online). So, I felt that I should write an article to explain how licensing of instances work and how we can use the instances.

Note: You need to have Global Administrator role on O365 tenant.

I have covered below concepts in this blog article:

  • What do you mean by Instance Type (Production/Sandbox)?
  • How user licenses work on multiple instances?
  • How licenses are assigned to different instances?
  • What are these features? (Copy instance, Reset Instance, Delete Instance, Configure Instance, Administration Mode etc.)

Introduction

What do you mean by Instance type (Production/Sandbox)?

  • Instance type decides what admin operations you can perform on your instance.
  • Product instance is considered as the live environment and hence you cannot perform some operations on Production type instance.
  • Sandbox instance is considered as non-production environment i.e. we can use it either for development or UAT. It may or may not contain live data.
  • Sandbox instances are cheaper in cost than production type instances.
  • You cannot have sandbox instance without a production instance. Once you have production instance, you can get as many sandbox instances as you want.
  • We always get production instance license when we register for Dynamics 365 Online trial.

How licenses work on multiple instances?

  • At high level, there are two kind of licenses available for Dynamics 365 Online, i.e., An instance license and user licenses.
  • Any CRM Online Instance is assigned either production or sandbox license.
  • Instance license assignment is not dependent on instance type. i.e. Sandbox type instance might be assigned production instance license as well based on license availability. I have explained all scenarios in Example section of this blog at the end.
  • Sandbox instance license is purchased as an add-on product.

How user licenses work on multiple instances?

  • User licenses are separate than instance licenses.
  • All licensed users automatically get added on all instances in the same tenant. Based on the security roles assigned, users get access to the respective instance.

Manage Features of D365 Online Instances

  • Copy Instance
    • This feature is useful when we want to make exact replica of any environment.
    • This feature allows to create exact replica of any instance from same tenant either with data or without data. In case of without data, all the customization get copied.
    • It only allows Sandbox Type instance as a target environment.
    • In copy operation, it copies entire database in the background on target environment. Source environment does not have any downtime during this operation.
    • Whenever copy operation is completed successfully, the target environment is put in administration mode. Whenever any environment (instance) is put in administration mode, only system administrators can log into the environment.
    • Copy operation does not change organization unique id of target environment.
  • Reset Instance
    • This feature is available only for Sandbox type instances.
    • This operation creates vanilla environment (similar as when you create trial environment).
    • Reset operation removes all data and customization from the environment.
  • Delete Instance
    • This feature is available only for sandbox type instances.
    • When this operation is performed, the respective instance license is released and is considered as unused license.

Note: Delete operation does not remove license and hence even if instance license is unused, we must pay for the same until we cancel subscription.

  • Configure Instance
    • This option is made available for unused instance licenses. Whenever we purchase any new instance license (either production license or sandbox instance) or when we delete an instance and if we have any unused license available, then we get this option.
    • This option allows to setup CRM instance starting from its URL & setting base currency.

Examples/Case Study

Business Scenario Assumption

Let’s assume we have a tenant with 5 CRM Online professional licenses (it comes with 1 production license) & 3 sandbox instance licenses. Let’s say we have below configured instances:

  1. https://instance1.crm.dynamics.com – Production Type Instance
  2. https://instance2.crm.dynamics.com – Sandbox Instance
  3. https://instance3.crm.dynamics.com – Sandbox Instance
  4. https://instance4.crm.dynamics.com – Sandbox Instance

Actions and Results

#

Action Performed Result

1

User tries to reset instance1 Reset option is not available on production type instances.

2

User tries to reset instance2 Instance2 gets reset and is created as vanilla environment as a trial environment.

Sandbox license is used.

3

User tries to perform copy operation from instance1 to instance2 without data. Instance2 becomes exact replica of instance1 without data. All customization from instance1 are now available on instance2.

4

User changes instance type of instance1 from Production to Sandbox. Instance1 is now considered as sandbox instance, but it is consuming production license.

5

User changes instance type of instance2 from sandbox to production. Instance2 is now considered as production environment. Instance2 is assigned production instance license and instance1 is assigned sandbox license.

6

User tries to delete instance4. Instance4 is deleted and 1 sandbox license is made available and is unused license.

7

User changes instance type of instance1 from sandbox to production again. Instance1 is now again considered as production instance & it will use sandbox instance license. There is still 1 unused sandbox license.

8

As 1 unused license is available, user gets an option to configure instance. User configures the instance. Instance4 is now again available as vanilla environment. It will use sandbox license.
  • All 5 professional licensed users have access on 4 instances and based on their security roles assigned on respective environments, they get access to those environments.
  • In case, you want to reset production environment for any reason, then you can do so by following below steps:
    • Change production instance’s type to sandbox instance.
    • Reset the environment.
    • Change instance’s type back to production instance.

Reference Links

Avoid issue of running multiple background workflow processes

Requirement

Whenever user sets due date on task record, a reminder should go to owner of the task.

Implementation Approach: We will implement this using a workflow with below configuration:

  1. Create a background workflow on task entity.
  2. Set trigger points of workflow as below:
    1. When record is created.
    2. When task due date is updated.
  3. Set workflow logic as below:
    1. Wait until Due Date becomes true (i.e. wait until due date arrives).
    2. On success, send email notification.

Note: In this blog, I have not focused on how workflow is created and how above steps are achieved.

Problem Statement

Above approach will not work properly in below scenario:

  1. User creates task and sets due date as 5 days later.
    1. A background process will be created and will go in wait condition.
  2. User again opens the task created above and updates the due date as 7 days later.
    1. In this case as well, new background process will be created and will go in wait condition.

Now, when actual due date arrives i.e. 7 days after, both of the background processes will be succeeded and 2 email notifications will be sent to the owner. This is incorrect and needs to be fixed.

Solution

To solve this issue, I have created a custom workflow assembly which checks active background process count associated with the record and returns the value back in output parameter. So, if we call this custom workflow as a first step in our workflow and if active session count is equals to 0, then we can proceed else we will stop workflow.

This way, at any given point of time, there will be only 1 active session which will be succeeded on actual wait condition success.

I have attached managed solution which contains below 2 components:

  1. Custom Workflow Assembly.
  2. A sample workflow on task entity (in deactivated state) to show an example and how to use it.

Download managed solution here.

How it works

how-it-works

Get lookup field’s data on child form using JavaScript without querying the record

Problem Statement

We come across one of the frequent requirement to populate fields on child record’s form from the lookup field’s data. Whenever user changes the lookup field’s value, the respective information on other fields on the form should be populated from lookup record. Below is an example:

We have an Employee entity and CTC entity. On CTC entity, we have lookup of Employee record. Employee entity contains below fields:

  1. Name
  2. Joining Date
  3. Gender

CTC entity contains below fields:

  1. Total CTC Amount
  2. Employee (Lookup)
  3. Employee’s joining date
  4. Employee Gender

Now the requirement is, on CTC record, when employee is selected, Employee’s joining date and gender should be populated from the employee record.

Old way

Till now, we used to achieve this by registering JavaScript method on change event of Employee field on CTC. Then through JavaScript call, we used to fetch employee record’s data and set the value after getting results.

New way (CRM 2016 onwards)

With latest CRM 2016 release, Microsoft has introduced new methods to access quick view form’s fields using XRM object. So, it helped in bypassing an additional call to the record and directly fetch data from the form itself. Below are the steps to achieve this requirement without making call to the record.

    1. Add quick view form on employee entity and add Joining date and gender field on the form.
    2. On CTC entity form, add quick view form of employee entity.
    3. Add JavaScript event on employee field’s change event and register below method on the same:
function populateFieldsFromEmployeeRecord()
{
	if(Xrm.page.getAttribute("new_employee").getValue())//new_employee is lookup field on CTC record
	{
		var quickViewControl = Xrm.Page.ui.quickForms.get("");
		if (quickViewControl && quickViewControl.isLoaded())
		{
			var gender = quickViewControl.getControl(0).getAttribute().getValue(); //you can use quickViewControl.getControl(0).getName() method to validate the field's logical name
			var joiningdate = quickViewControl.getControl(1).getAttribute().getValue();
			Xrm.Page.getAttribute("new_gender").setValue(gender);
			Xrm.Page.getAttribute("new_joiningdate").setValue(joiningdate);
		}
	}
}

That’s it.

How to remove business process flows from existing records?

Problem Statement

Many times we come to a scenario where clients ask to remove business process flows from the production environments. In such scenarios, there are chances that on the existing records, the business process flows are already set on the records. Hence even if we deactivate the business processes, we still see a yellow ribbon as per below screenshot:

error

So, how to fix this issue?

Solution

  • First of all, we should not directly delete the business processes as clients might ask to reactivate the same and we don’t want to rework on the complex logic we have already implemented.
  • So, to remove above issue while keeping backup of the business process, we will have to follow below steps:
    • Go to Setting > Processes
    • Select the business process flow and deactivate it.
    • Open Business process flow and click on the Save As option from the top ribbon.
    • Delete the old business process flow.
  • After following above steps, you should be able to see that, business process section from existing records is removed and no warnings are shown at the same time, we have backup of the process which we can reactivate in future if needed.

How to insert hyperlink with friendly URL in Email Templates in CRM

Problem Statement

  • Many times we came across the scenario to have links in email templates and make the email template better in presentation aspect with the help of HTML.
  • This blog explains how can you add hyperlink with friendly URL in Email templates.

Business Scenario

  • ‘Adventure Works’ company wants to send email notification to case owner on create of case with below email format.

template-format

  • Click here should navigate user to URL stored in Custom URL field of Case entity.
  • We will achieve this requirement with the help of email template.

Note: I have not covered creation of workflows in this blog. I will use workflow on create of case record to send email using below email template.

Steps to create email template

  • Click New. Select Template Type as Case.
  • Go to Settings > Templates > Email Templates

template-type

  • Create template body as per below:

template-body

Below will be the output:

email output.png
Enter a caption