Category: Uncategorized

Renaming Attributes on Entity Form: Dynamics 365 Portal

While working on Microsoft Dynamics 365 Portal one of the requirement we had was to rename certain fields on Portal so that those are more self explanatory to portal users.

 

To do that for entity form,

  • Go to Entity form Record.
  • Scroll down to “Entity Form Metadata” sub-grid.
Dynamics 365 Entity Form
  • Create a new entity form metadata record of type Attribute and Select the Attribute.
  • Update Label field to display the relevant label on the form.
Dynamics 365 Attribute Metadata

 

To update label in entity list,

  • Go to entity list record,
  • Scroll down to “Options” tab and “Grid Configuration” section.
  • In “Override Column Attributes” select “Attribute”, key in “Display Name”, put column width in pixel (percentage was not working for me).
Dynamics 365 entity list

Using Dynamics 365/CRM App Designer (Part 2 of 2)

In previous post we created a basic app and saw how we can control different components within an app.

In this post we will see how to restrict the access to specific app based on user role.

For this:

1.  Go to Settings –> Application –> My Apps

Somehow “My Apps” is not available under CRM default app/sitemap but it is available under others like Sales and Customer Service App.

image

In case you don’t have it you can navigate to it by path “https://instancename.crm.dynamics.com/tools/AppModuleContainer/applandingtilepage.aspx”

Replace inastancename.crm with your org and region specific path.

 

2. On all apps (other than default) you can select “Manage Role” under settings and select that app should be visible for which security role.

 

image

 

image

NOTE: You can’t remove access from “System Administrator” and “System Customizer”

 

3. In case you want to hide default app of dynamics CRM then

Go to Settings –> Administration –> System Settings

Under General Tab “Set option for Default App: to No.

image

 

With above settings relevant apps can be displayed to users and all non relevant apps can be hidden from UI.

Using Dynamics 365/CRM App Designer (Part 1 of 2)

One of the newer features of Dynamics CRM is introduction of App Designer. This feature is replacing old concept of Site Maps in Dynamics CRM. With this feature we can rely on easy to use interface from product itself to select which entities will be visible in top navigation to users.

So no more relying on xml editing or third party tools.

What is an App in Dynamics 365 ?

When you launch Dynamics 365, on left hand side you can click small Arrow to see list of Apps. These can be third party apps (if you have installed those) or product apps specific to business functions.

You can also define your own apps here.

image

 

How do I create an App which is specific to my Business Requirements ?

Steps are simple:

1. Go to Settings –> Solutions –> Either Create a New Solution or open existing project specific solution.

There will be a section for Apps at bottom of left navigation.

image

 

2. Click App –> New and App designer window will appear.

You can provide properties like App Name (Visible in Home page App navigation) and URL Suffix ( Easy to remember path)

3. Once you have created app, Click Arrow near “Site Map”

image

 

4. Click on Area, Give it a Valid name,  Group, Sub Group and So on.

You can click add button on top to add more areas, group etc…  or Right Component Section to Drag areas, groups etc…

Iimage

5. On Save and Close of Site Map editor, you will see the entities you have selected are available in your entity View.

Deciphering the main App Areas.

Site Map : To design top navigation of Dynamics CRM interface.

Dashboard/Business Process Flows: To select dashboards and business process flows available within this app.

Entity View: This will dynamically include entities based on your sitemap, dashboards and business process flows. Here you can select which forms, views and charts that are visible in given app.

image

 

For demo I will keep it simple and select two views (Active and Inactive Accounts/Contacts), validate and Publish the App.

 

Result Post Update

Default Site Map:

image

 

Updated Site Map

imageimage

 

 

 

Default List of Views:

image

 

List of Views in App  (Only Active and Inactive)

image

 

Above steps helped us in creating a new app for our organization and restricted System Views .

Note that system views will not be restricted in Advanced Find.

In Next post I will highlight how to restrict access to apps based on security roles.

Dynamics 365: Simple Business Rules for Date validation

With the change in UI for Business Rules in Dynamics 365, which was supposed to be a simpler UI and visually appealing seems to lag intuitiveness as it takes couple to tries to understand how to work with it.

  • In given example I am having an entity for Absence Calendar for users.
  • I have start date and end date for users. Validation is that End Date should be >= start date.

 

  1. Go to your solution -> expand the entity -> click on business rules -> click new

 

  1. Key in the Business Rule Name

     

     

  2. Click on Condition Box and on right side under properties you will see UI to update condition.

     

  3. Update the rule condition and click apply.

     

  4. Click on Add -> Add Show Error Message. It will display plus sign near condition success and failure. Click on the + sign near positive condition

     

  5. On right hand select the field where the error message should display. Key in the error message and click apply.

     

  6. Now Save -> Activate the Business Rule.

New in Dynamics 365: Web API Enhancements

With Dynamics 365 Microsoft has provided certain enhancements with Dynamics CRM Web API.

It provides you much more flexibility while working with Entity Metadata, Global option sets and relationship definition to retrieve specific records rather than just complete list.

Reference: https://msdn.microsoft.com/en-us/library/mt607833.aspx

To navigate to Web API reference you can navigate to:

https://OrgURL/api/data/v8.2

If you do a quick comparison between a Dynamics 365 web api metadata and Dynamics CRM 2016 metadata you will see various difference in both.

Most of those differences are due to new Entities being introduced in Dynamics 365. There are four Entity set path of interest which you will find at end of the JSON file.

Examples of various scenarios which can be used with update web api are:

  • Using EntityDefinitions

    To Get Entity Metadata

    1. For whole organization

https://dynamics365demo01.api.crm5.dynamics.com/api/data/v8.2/EntityDefinitions

2. Or get it by entity logical name

https://dynamics365demo01.api.crm5.dynamics.com/api/data/v8.2/EntityDefinitions(LogicalName=’account’)

3. Or Do a filter to get list of all entities meeting criteria (like ismanaged = ‘true’)

https://dynamics365demo01.api.crm5.dynamics.com/api/data/v8.2/EntityDefinitions?$filter=IsManaged eq true

4. Or get metadata of all attributes within entity

https://dynamics365demo01.api.crm5.dynamics.com/api/data/v8.2/EntityDefinitions(LogicalName=’account’)/Attributes

5. Or get details specifically of one attribute by logical name

https://dynamics365demo01.api.crm5.dynamics.com/api/data/v8.2/EntityDefinitions(LogicalName=’account’)/Attributes(LogicalName=’name’)

Reference: https://msdn.microsoft.com/en-us/library/mt607522.aspx

  • Getting Global Optionset
  1. Complete list of global optionsets

    https://dynamics365demo01.api.crm5.dynamics.com/api/data/v8.2/GlobalOptionSetDefinitions

  2. Or get it by Name

    https://dynamics365demo01.api.crm5.dynamics.com/api/data/v8.2/GlobalOptionSetDefinitions(Name=’purchasetimeframe’)

Note: No filter supported for this.

  • Getting Relationship Definitions
  1. Complete list of relationship schema

    https://dynamics365demo01.api.crm5.dynamics.com/api/data/v8.2/RelationshipDefinitions

  2. Specific Relationship Specifications

    https://dynamics365demo01.api.crm5.dynamics.com/api/data/v8.2/RelationshipDefinitions(SchemaName=’account_parent_account’)

New in Dynamics 365: Areas of Interest for Developers

With the avalanche of new featured with Dynamics 365 there are various new featured which we have been looking into. With many features which are easily visible at UI there are various internal plumbing in Dynamics 365 which will help in making the whole development experience smoother.

Few of the non-UI features that have been introduced in Dynamics 365 are:

  • Dynamics 365 Web API enhancements
  • Define access permissions for modular business apps programmatically <Preview>
  • Use form scripts to add icons with tooltip text for view columns <Preview>
  • New client side APIs for Offline mobile app
  • Client side API for editable grid
  • Capability to get geo location and barcode info in mobile apps.
  • More powerful access to business processes through custom code
    • Enhanced client script
    • Enhanced web api

New in Dynamics 365: Editable Grid Properties

Few questions I had while thinking about Editable Grid:

  1. Where can I have editable grid?
  • The editable grid control is supported in the homepage grid, form grids and subgrids on the web client, and in dashboards and form grids on the mobile clients.

 

  1. Once editable grid is enabled, Are we stuck with it forever, Can I switch to Regular grid if required.
  • Points to note:
    • Regular grid is called Read Only Grid,
    • You can Switch between Read-only and Editable grid from Ribbon

 

  1. What can be done on Editable Grids (other than editing):
  • Group <NEW>
    • The data can be grouped on the Grid view using “Group By” drop down on top of the grid
    • Grouping drop down will display all the fields on the view.

       

  • Sort

     

  • Filter <Modified UI Behavior>
    • The filter view you get on the editable grid is more in line with Custom Filter which we have on Read-Only view.

 

  1. If I migrate from older version of Dynamics CRM will entities support editable grid without any code change?
  • No, as based on the test I did form scripts and Business rules are not working on editable grid. So it might break certain validations.

    Form Level Control

    Editable in GRID : Fields are editable


     

  1. Can I control the edit behavior and lock these fields using client side scripting
  • Seems possible as editable grid supports certain events, methods and properties which can be used to achieve this. I will cover these in details in a later post.
    • Events Supported
  1. OnRecordSelect – Possibly to be used as OnLoad of record to lock the fields or register other scripts.
  2. OnChange – OnChange of Attribute/Cell property
  3. OnSave – OnSave of record

 

  • Methods/Properties Supported
  1. GridControl – To get editable grid control by name
  2. Grid – GridControl .getGrid() -> Child properties for this are getRows, getSelectedRows, getTotalRecordCount
  3. GridRow – GridControl.getGrid().getRows()/ GridControl.getGrid().getSelectedRows()
  4. GridRowData – GridControl.getGrid().getRows()[0].getData();
  5. GridEntity – GridRowData.getEntity() -> GridRowData.getEntity().getEntityName(), GridRowData.getEntity().getEntityReference(), GridRowData.getEntity().getId()
  6. GridAttribute – GridRowData.getEntity().getAttribute(“name”) -> GridAttribute.getName(), GridAttribute.getRequiredLevel(), GridAttribute.setRequiredLevel(), GridAttribute.getValue(), GridAttribute.setValue();
  7. GridCell – GridCell.clearNotification(), GridCell.setNotification(), GridCell.getDisabled(),GridAttribute.setDisabled(),GridAttribute.getLabel()

     

  1. Are Editable fields supported on All Entities and Views
  • On the web client, an entity will support editable grid if all of the following conditions are true:
    • The entity is customizable (IsCustomizable = true)
    • The entity is either refreshed (IsAIRUpdated = true) or a custom entity (IsCustomEntity = true)
    • The entity is not a child entity (IsChildEntity = false)
  • Dynamics 365 mobile client, an entity will support editable grid if the entity can be displayed in the mobile client’s site map.
  • Editable grids do not support roll up associated views (Rollup type = Related).

 

Reference: https://msdn.microsoft.com/en-us/library/mt788312.aspx

New in Dynamics 365: Editable Grid Properties

Few questions I had while thinking about Editable Grid:

  1. Where can I have editable grid?
  • The editable grid control is supported in the homepage grid, form grids and subgrids on the web client, and in dashboards and form grids on the mobile clients.

 

  1. Once editable grid is enabled, Are we stuck with it forever, Can I switch to Regular grid if required.
  • Points to note:
    • Regular grid is called Read Only Grid,
    • You can Switch between Read-only and Editable grid from Ribbon

 

  1. What can be done on Editable Grids (other than editing):
  • Group <NEW>
    • The data can be grouped on the Grid view using “Group By” drop down on top of the grid
    • Grouping drop down will display all the fields on the view.

       

  • Sort

     

  • Filter <Modified UI Behavior>
    • The filter view you get on the editable grid is more in line with Custom Filter which we have on Read-Only view.

 

  1. If I migrate from older version of Dynamics CRM will entities support editable grid without any code change?
  • No, as based on the test I did form scripts and Business rules are not working on editable grid. So it might break certain validations.

    Form Level Control

    Editable in GRID : Fields are editable


     

  1. Can I control the edit behavior and lock these fields using client side scripting
  • Seems possible as editable grid supports certain events, methods and properties which can be used to achieve this. I will cover these in details in a later post.
    • Events Supported
  1. OnRecordSelect – Possibly to be used as OnLoad of record to lock the fields or register other scripts.
  2. OnChange – OnChange of Attribute/Cell property
  3. OnSave – OnSave of record

 

  • Methods/Properties Supported
  1. GridControl – To get editable grid control by name
  2. Grid – GridControl .getGrid() -> Child properties for this are getRows, getSelectedRows, getTotalRecordCount
  3. GridRow – GridControl.getGrid().getRows()/ GridControl.getGrid().getSelectedRows()
  4. GridRowData – GridControl.getGrid().getRows()[0].getData();
  5. GridEntity – GridRowData.getEntity() -> GridRowData.getEntity().getEntityName(), GridRowData.getEntity().getEntityReference(), GridRowData.getEntity().getId()
  6. GridAttribute – GridRowData.getEntity().getAttribute(“name”) -> GridAttribute.getName(), GridAttribute.getRequiredLevel(), GridAttribute.setRequiredLevel(), GridAttribute.getValue(), GridAttribute.setValue();
  7. GridCell – GridCell.clearNotification(), GridCell.setNotification(), GridCell.getDisabled(),GridAttribute.setDisabled(),GridAttribute.getLabel()

     

  1. Are Editable fields supported on All Entities and Views
  • On the web client, an entity will support editable grid if all of the following conditions are true:
    • The entity is customizable (IsCustomizable = true)
    • The entity is either refreshed (IsAIRUpdated = true) or a custom entity (IsCustomEntity = true)
    • The entity is not a child entity (IsChildEntity = false)
  • Dynamics 365 mobile client, an entity will support editable grid if the entity can be displayed in the mobile client’s site map.
  • Editable grids do not support roll up associated views (Rollup type = Related).

 

Reference: https://msdn.microsoft.com/en-us/library/mt788312.aspx

New in Dynamics 365: Editable Grid

It’s a long awaited feature is available in Dynamics 365 which was not available in previous versions and customers constantly requested for it.

To enable Editable grid

  1. Navigate to the Settings -> Customizations -> Customize the System

 

  1. Expand Entities -> Select the Entity you want to enable Editable Grid on -> Select Controls

     

  2. Click “Add Control” -> Editable Grid -> Add

     

  3. Select where you want to use editable grid as default (Web, Phone, Tablet), Select Editable Grid Properties and Add Lookup, Select Available Views and Available Columns and Ok

     

  4. Click save and publish.
  5. Navigate to the View you configured as Editable, Properties should be editable.