The trick to force / trigger user sync – Power Platform / Dynamics 365


Sometimes it takes a long time for the users to appear in Dynamics 365, even though users have the appropriate licenses.

E.g. here we have added user6 in Microsoft 365 Admin Center.

Back in CRM, we do not see user 6 added.

One way to add the user is through Force Sync User action of Power Platform Management connector.

https://nishantrana.me/2021/12/13/using-force-sync-user-to-sync-powerapp-crm-users-power-platform-dynamics-365/

or the other option is to ask the user to log in to the Power Apps.

As soon as the user logs in we can see his account added/synced to the enabled users in CRM.

Thanks to Emre Gulcan for this trick

Hope it helps..

Advertisements

Using Force Sync User to sync PowerApp / CRM users – Power Platform / Dynamics 365


Recently in one of our trial environments, some of the users were not showing up in the Enabled Users view in Dynamics 365, although the users were having appropriate licenses assigned to them. (was more than 24 hours)

In such a scenario we can use Force Sync user action of Power Platform Management Connector.

https://docs.microsoft.com/en-us/connectors/powerplatformforadmins/

For Force Sync users, we will be passing the object id of the user and selecting the appropriate environment.

Run the flow manually.

It asks for the Object Id of user.

Inside Azure Portal >> Azure Active Directory >> Users, get the Object Id of the user

Currently, we have below 3 users in CRM

Let us run the flow.

Wait for the flow to complete.

After successful execution of the flow, back in CRM, we can see user 5 added to the list of enabled users.

In case we are using a security group for the environment we can make use of the below Power Automate Template, it takes the security group’s object id as input and loops through each of the members and applies Force Sync user action.

We can also make use of PowerShell cmdlets to achieve the same

https://nishantrana.me/2021/01/20/force-sync-users-from-azure-ad-to-dynamics-crm/

Force Sync Azure Active Directory Group members to specified CDS instance

Hope it helps..

Advertisements

Using Custom Process Action with Code for integration – Dynamics 365 / Microsoft Dataverse


There are 2 ways to create a custom message in Dataverse, one is through action, and the other is through Custom API.

Check the post on Custom API

https://nishantrana.me/tag/custom-api/

https://nishantrana.me/2021/01/13/use-custom-api-to-create-custom-messages-in-dynamics-365/

Custom Process Action vs Custom API –

https://docs.microsoft.com/en-us/powerapps/developer/data-platform/custom-actions#compare-custom-process-action-and-custom-api

With custom process action we can define business logic using a workflow, and we can extend it using either custom workflow activities or registering the plugin.

If we are just defining action just for the custom message and then using plugin/custom workflow activity for defining all the logic (and not using workflow), it is recommended to use the Custom API feature instead.

Here however we will have a look at the way we had implemented global custom action for integration with the external system for any inbound call to CRM.

Below is our sample custom global action with one input and output parameter.

For the output parameter, we are setting the value in the step.

Next, we have 2 plugin steps registered one on the pre-validation stage and the other on post-operation.

Pre-validation because we want to run the logic outside the transaction, perform validation, log exceptions, etc.

Pre-validation example –

https://nishantrana.me/2018/11/05/plugin-on-pre-validation-stage-in-dynamics-365-ce/

https://community.dynamics.com/365/sales/b/crminogic/posts/plugin-pre-validation-operation-to-show-an-error-message-as-well-as-log-the-error

Post-operation because action’s output parameter would only be available in the post-operation and used Shared Variable to pass the custom response from pre-validation plugin to post-operation.

On executing the action

We get the following plugin trace logs as expected.

One for pre-validation

Post-operation

Hope it helps..

Advertisements

Fixed: Action not appearing in Plugin Registration tool (Dynamics 365 / CE)


We had couple of actions created, but they were not appearing in the Plugin Registration Tool Plugin of XrmToolBox as shown below.

Refreshing the plugin, re-connecting to the organization, republishing the action, etc. didn’t work.

Eventually, we restarted the XrmToolBox and our messages started appearing.

Could be something related to Metadata cache.

Hope it helps..

Advertisements

Fixed – Unified routing was unable to provision error while trying to configure Unified routing


Recently while trying to set up Unified Routing, we got the below error.

“Unified routing was unable to provision. Please try again or contact Microsoft Support”

The user had the system administrator role and we already had the global administrator’s consent, which should be good enough to set up unified routing.

We tried with different system administrator users but that doesn’t resolve that error.

Eventually, we tried the setup with the same user but in a different VDI (Virtual Desktop Infrastructure), and the setup worked properly without any error. One probable reason could be, that the appropriate URLs being accessed during setup were already whitelisted in the other VDI, which wasn’t the case in the first VDI where we were trying.

Hope it helps..

Advertisements

Fixed – We couldn’t load your user roles from the selected Dynamics 365 Organization error while trying to set up Microsoft Dynamics 365 Marketing


Recently while trying to set up Microsoft Dynamics 365 Marketing on an existing Dataverse environment, we got the below error.

“We couldn’t load you user roles from the selected Dynamics 365 Organization. Please try again”

The user had the system administrator role, which is good enough to set up marketing.

We tried replicating the same in other trial environments but were not able to replicate the above error.

Eventually, we tried the setup with the same user but in a different VDI (Virtual Desktop Infrastructure), and the setup worked properly without any error. One probable reason could be, that the appropriate URLs being accessed during setup were already whitelisted in the other VDI, which wasn’t the case in the first VDI where we were trying earlier.

Hope it helps..

Advertisements