Featured

Recent Posts


Allowed Custom Processing Step Type (AllowedCustomProcessingStepType) property of Custom API in Dynamics 365 / Microsoft Dataverse

Continuing our previous posts, let us check the AllowedCustomProcessingStepType attribute in this blog post https://nishantrana.me/2021/01/13/use-custom-api-to-create-custom-messages-in-dynamics-365/Continue reading “Allowed Custom Processing Step Type (AllowedCustomProcessingStepType) property of Custom API in Dynamics 365 / Microsoft Dataverse”

Loading…

Something went wrong. Please refresh the page and/or try again.

Advertisements

Export key attribute uniquename for component CustomAPI must start with a valid customization prefix exception while creating Custom Action in Dynamics 365


We might get below error while creating a custom action from the maker portal without specifying the prefix.

Unhandled exception:

Exception type: System.ServiceModel.FaultException`1[Microsoft.Xrm.Sdk.OrganizationServiceFault]

Message: Export key attribute uniquename for component CustomAPI must start with a valid customization prefix

As the message suggests, we need to add prefix to the Unique Name of the custom API.

Check the prefix of the solution publisher and specify the same.

Adding the prefix allows us to save and create the Custom action record.

Microsoft docs suggest that is should match the prefix specified for the solution publisher

but it seems we can specify any prefix there and it allows us to save the record.

More on Custom API –

Create Custom API Message –
https://nishantrana.me/2021/01/13/use-custom-api-to-create-custom-messages-in-dynamics-365/

Execute Privilege Name Property –

https://nishantrana.me/2021/01/14/execute-privilege-name-executeprivilegename-property-of-custom-api-in-dynamics-365-microsoft-dataverse/

Allowed Custom Processing Step Type Property –

https://nishantrana.me/2021/01/20/allowed-custom-processing-step-type-allowedcustomprocessingsteptype-property-of-custom-api-in-dynamics-365-microsoft-dataverse/

Hope it helps..

Force Sync Users from Azure AD to Dynamics CRM


At times after assigning the appropriate license to the User / adding them to Azure AD Security Group associated with the environment, the users do not appear within CRM, or it takes long time for them to appear.

We can use the PowerShell cmdlet shared in the blog.

The same thing can be achieved using Force Sync User Action within Power Platform for Admins Connector (Preview)

https://docs.microsoft.com/en-us/connectors/powerplatformforadmins/#force-sync-user

We can make use of the template which uses the above action

https://us.flow.microsoft.com/en-us/galleries/public/templates/6e4162ca7afc48479e3ad1caadc6c1e6/force-sync-azure-active-directory-group-members-to-specified-cds-instance/

lastly from Admin Portal, we can also try removing Security Group from the environment, and adding it back, or adding removing the license from the user, which triggers the sync.

If nothing helps the last resort is to raise the Microsoft Support Ticket.

Power Platform

When an new Environment is created, it takes more than an hour or some times a day to sync users from Azure AD to CRM.

Through Power Shell cmdlets, we can sync user immediately.

Install Module Microsoft.PowerApps.Administration.PowerShell

Install-Module -Name Microsoft.PowerApps.Administration.PowerShell

Connect to Power Apps using any of these

  • User Name and Password
Add-PowerAppsAccount -Endpoint "prod" -Username "" -Password ""

  • Tenant Id, Client Id and Client Secret
Add-PowerAppsAccount -Endpoint "prod" -TenantID "" -ClientSecret "" `
-ApplicationId ""

  • Tenant Id, Client ID and Certificate Thumbprint 
Add-PowerAppsAccount -Endpoint "prod" -TenantID "" -CertificateThumbprint "" `
-ApplicationId ""

Get-AdminPowerAppEnvironment cmdlet gives list of environments available in Tenant, note down the environment name (guid) to which you want to sync the Users

Go to Azure Portal : https://portal.azure.com -> Azure AD -> Users -> note down the Object Id of the user you want to sync

Run the cmdlet in Power Shell

Add-AdminPowerAppsSyncUser -EnvironmentName <Guid> -PrincipalObjectId…

View original post 30 more words

Dynamics CRM On Premise Maintenance Jobs!


Ricky Safford Development Repository

Please remember to reschedule these maintenance jobs after the installation of CRM is completed.

Maintenance Job NamePurposeDefault Frequency/ Recommendation
Deletion ServiceThe deletion service maintenance operation now cleans up subscription tracking records for deleted metadata objects as they expire.

If Outlook does not sync for 90 days, the job will remove the subscription with CRM.

Cleanup POA records. Un-sharing of record(s) do not remove the records in the POA table, it will stay there for 90 days and it will clean up by the deletion job.

Cleanup failed/stuck workflows for the record(s) synchronize with Outlook.

By default, the job executes every 24 hours, reschedule the job to run at non-peak hours. E.g. 11:00PM at night
Indexing ManagementValidates that system-managed indexes exist for all entities and recreates any missing indexes.

This is more for CRM Online and only impacts us during configuration of the solution. It automatically creates…

View original post 1,568 more words

Allowed Custom Processing Step Type (AllowedCustomProcessingStepType) property of Custom API in Dynamics 365 / Microsoft Dataverse


Continuing our previous posts, let us check the AllowedCustomProcessingStepType attribute in this blog post

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

https://nishantrana.me/2021/01/14/execute-privilege-name-executeprivilegename-property-of-custom-api-in-dynamics-365-microsoft-dataverse/

Allowed Custom Processing Step Type attribute of custom API allows us to control whether other plugins can be registered or not against the custom message

  • 0 – None – No custom processing steps are allowed.
  • 1 – Async Only– Only Async processing steps are allowed.
  • 2 – Both Async and Sync custom processing steps are allowed

Let us create a custom API with the value of “Allowed Custom Processing Step Type” as None.

If we check inside the Plugin Registration tool, we will not find the above message that we registered i.e. my_sampleAPI there.

Let us create another custom API and specify “Allowed Custom Processing Step Type” as Async Only.

As expected we can find the message available there.

As it is Async Only, if we try to register the step with Synchronous mode, we will get the below error.

Custom SdkMessageProcessingStep is not allowed on the specified message and entity.

As expected it allows us to register the step in asynchronous mode.

Get more details –

Create and use Custom APIs

Hope it helps..

Unable to retrieve attribute=businessunitid for entityLogicalName=systemuser exception while creating Application User in Dynamics 365


Recently while trying to add a new application user we got the below error message

More on Application User

https://nishantrana.me/2020/12/24/application-user-form-missing-in-dynamics-365/

https://nishantrana.me/2020/12/23/d365-the-user-is-not-a-member-of-the-organization-error-while-connecting-to-ce/

Adding the missing Business Unit field in the form fixed it.

Hope it helps..

Manage Dynamics 365 Web API with Azure API Management


Azure API Management is an Azure service to create consistent API gateways for secure, scalable access for back-end applications and services.

Azure API Management consists of 3 main components

  • API Gateway

  • Azure Portal for administration

  • Developer Portal for API documentation

Each API inside Azure API Management contains a reference to the back-end service that implements the API and its operations.

Let us start by creating the Azure API Management resource –

Login to Azure Portal

https://portal.azure.com/

Search for API Management

Provide the appropriate details. (Here we have selected the – Developer tier)

After validation is passed, review and click on Create.

It will take around 30 minutes for the deployment to be finished

After the deployment is successful, we can navigate to it and can find the Gateway URL and Developer portal URL as shown below.

Here we will start with a Blank API.

Specify the display name, name and for Web service URL the URL of Dynamics 365 Web API

Click on +Add operation to add a new operation to the API.

Specify the URL as shown below to fetch all the contacts from Dynamics 365.

The URL of the operation

Right now we will get the 401 error as expected as we have not passed the token expected by the Web API.

Now for the token part for calling the Dynamics 365 API, register the Application in Azure AD, create a new Application User, and assign appropriate security roles to it.

https://docs.microsoft.com/en-us/powerapps/developer/data-platform/authenticate-oauth#connect-as-an-app

Here we would be defining send-request policy, to generate the Token and pass it in the Authorization header to the Dynamis 365 Web API request.

Select the GET operation, navigate to the Design tab and open the policy code editor for inbound processing

Add the send-request and set-header policy to generate and set the bearerToken

Specify the endpoint URL of OAuth token, client id, client secret of the application registered.

"copy code from the end of the post"

Save the change and let us test the API.

We can see the results as expected.

The other things that can be done are to associate the API with Products, specify Subscription, Security, enable Application Insights, Azure Monitor etc.

Specify policies –

https://docs.microsoft.com/en-us/azure/api-management/api-management-policies

References

https://transform365.blog/2020/03/29/azure-api-management-and-dynamics-365-web-api/

https://app.pluralsight.com/library/courses/microsoft-azure-developer-implement-api-management/table-of-contents

Hope it helps..

<policies>
  <inbound>
    <base />
    <send-request mode="new" response-variable-name="bearerToken" timeout="20" ignore-error="true">
      <set-url>https://login.microsoftonline.com/89a735bf-2d85-4a5b-a74a-59656af50f2e/oauth2/token</set-url>
      <set-method>POST</set-method>
      <set-header name="Content-Type" exists-action="override">
        <value>application/x-www-form-urlencoded</value>
      </set-header>
      <set-body>@{ return "client_id=510b66c9-4841-4d3d-8e95-150779adcb3e&resource=https://gcrm.crm.dynamics.com&client_secret=t~6DU7Ma4GZjh.M0Xf7eCizy.E~ME4zy_3&grant_type=client_credentials"; }</set-body>
    </send-request>
    <set-header name="Authorization" exists-action="override">
      <value>
        @("Bearer " + (String)((IResponse)context.Variables["bearerToken"]).Body.As<JObject>()["access_token"])</value>
    </set-header>
  </inbound>
  <backend>
    <base />
  </backend>
  <outbound>
    <base />
  </outbound>
  <on-error>
    <base />
  </on-error>
</policies>
Advertisements