Month: November 2016

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.