How to refresh or navigate to Entity View

In some scenarios we all have to refresh or navigate to specific entity view after a particular action performed. We can use a method called navigateTo() for this requirement. This method is available under new Namespace Navigate.

Syntax:

Xrm.Navigation.navigateTo({ pageType, entityName, viewId, viewType }).then(successFunction, errorFunction);

  1. pageType: Specify “entitylist”.
  2. entityName: Provide the logical name of the entity.
  3. viewId (Optional): Provide the Guid of the view to load. If you don’t provide it, it will navigate to the default view of an entity.
  4. viewType (Optional): Provide the Type of the view to load. For ex: “savedquery” or “userquery”. It is required only if you want to navigate to a specific view.

Example:

  • Without View Id:

Xrm.Navigation.navigateTo({ pageType: “entitylist”, entityName: “account” }).then(
function (result) {
//Success code
},
function (error) {
//Error code
}
);

  • With View Id:

Xrm.Navigation.navigateTo({ pageType: “entitylist”, entityName: “account”, viewId: “4ec687fd-9858-4e8c-b267-63add9769d77”, viewType: “savedquery” }).then(
function (result) {
//Success code
},
function (error) {
//Error code
}
);

Note: At the moment, this method is supported only on the Unified Interface

Hope it is helpful…..

Advertisement

How to remove Unmanaged customizations on Managed component

This is a common issue everyone would have faced once in a while that the customizations were not getting applied on the target instance through solution deployment. This is due to the direct changes on the component which is part of managed solution.

A component which is managed, gets an unmanaged layer as soon as you edit it directly on the instance. This unmanaged (active) layer lays on top of all other layers, which are coming from the different solutions containing this component. The layer on top is always winning, hence you can’t see the new changes coming from new deployments.

To avoid this issue, Microsoft introduced a new feature called “Solution Layers” where you can see all solutions where this component is part of it. You can see one “Active” solution on top of all solutions if you would have changed something directly on the instance. So, to get rid of the unmanaged customizations on managed component, you have to follow the below steps.

  1. Select the component and Click on “Solution Layers” button (some times you can see this option under “More Actions” drop down menu).

2. On click of this button, it will show the list of all solutions which included selected component, as shown in the below screenshot.

3. Select the 3 dots (…) of “Active” solution row, select “Remove Active Custmoziations” option and confirm.

4. That’s all you have to do to remove all unmanaged customizations, after that the changes will be affected which are coming from new deployments.

I faced this situation so many times, the changes I have done for ex. in web resources in dev instance couldn’t transfer to UAT/Prod instance due to the “Active” solution layer. So with this new feature, you could remove this unwanted solution layer with a single button click.

Note: Microsoft not yet rolled out this feature for some components like Views and Fields. (Thanks Viswanath for highlighting this in your comment)

Hope it is helpful….

The user with SystemUserId in OrganizationContext is not licensed

Today while creating Account record, I got the below error.

The user with SystemUserId = “” in OrganizationContext = “” is not licensed, and its SystemUserAccessMode=0 is not either of (NonInteractive=4, SetupUser=1)

I did the below steps to resolve this issue

  1. I checked the “AccessMode” of the logged in user but it sets to “ReadWrite” mode which is OK.
  2. I compared the Guid of the logged in user and SystemUserId from the error message, both are not same, so decided that there is no problem with logged in user.
  3. Finally, I did check the processes and I found there is one process which is running on create of Account owned by an disabled user.

I assigned this particular process to another service user which resolves this issue.

Hope this helps.

Business Unit Hierarchy – My First XrmToolBox Plugin

I am very happy to announce that my first plugin “Business Unit Hierarchy” is listed in XrmToolBox now.

Thanks to Nishant Rana for giving me an idea to develop this.

This plugin is simple but very useful. Most of the times we navigate to so many windows to understand the BU hierarchy in our organization (I faced this situation many times) but with this plugin it is very easy to get the complete overview of BU Hierarchy. I plotted the BU Hierarchy in tree view presentation which is easy to understand for any user.

Here are list of steps to use this plugin

  1. Install “Business Unit Hierarchy” plugin from XrmToolBox Plugins Store.
  2. Connect to your organization.
  3. Open the plugin and click on “Load Business Unit Hierarchy” button.

That’s it, Business Units of your organization will be loaded in a hierarchical structure like in the above screenshot. The BU’s that are loaded in red color are disabled ones. Select any BU to see all the Users and Teams under this.

Hope it helps to everyone and saves time to understand the BU Hierarchy.

Please leave your feedback and rating on this plugin in the below link https://www.xrmtoolbox.com/plugins/XrmTools.BusinessUnitHierarchy