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.
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.
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.
Originally posted on Ricky Safford Development Repository: Please remember to reschedule these maintenance jobs after the installation of CRM is completed. Maintenance Job…
Originally posted on Matthew Webb's Dynamics 365 Blog: Recap Best Practices: Part 2 Welcome back! My previous blog discussed the use of Staging Databases as…
To test, we updated the security of the Application User to Sales Manager role which doesn’t have the create incident privilege.
Calling the custom API this time as expected gave us the below error
{“error”:{“code”:”0x80040220″,”message”:”Principal user (Id=0f377e29-5545-eb11-a813-000d3a9bf733, type=8, roleCount=1, privilegeCount=727, accessMode=4), is missing prvCreateIncident privilege (Id=6cf9442b-e690-4cad-8b0a-e60464960b93) on OTC=112 for entity ‘incident’. context.Caller=0f377e29-5545-eb11-a813-000d3a9bf733″}}
If we specify an incorrect privilege name we would get the below error and will not be able to save the record.
Originally posted on CRM & Coffee: Hello team, This week I have been working with Certificates a LOT, and let me tell you, it’s a world on its own, I always had a lot of respect for the people that work on that field, now my respect is…
Originally posted on 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…
Originally posted on Ricky Safford Development Repository: Please remember to reschedule these maintenance jobs after the installation of CRM is completed. Maintenance Job Name Purpose Default Frequency/ Recommendation Deletion Service The deletion service maintenance operation now cleans up subscription tracking records for deleted metadata objects as they expire.…
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 … Continue reading “Manage Dynamics 365 Web API with Azure API Management”
Custom API (preview) allows us to define our custom messages that can be called from web services, similar to Custom Actions. Usually, we would be creating custom workflow actions just to create a new message, to which we can hook our plugin, without defining any logic in the workflow. For this scenario or pattern now we can use Custom API instead.
There are different ways of creating a custom API.
Through the Maker Portal.
Using Web API or Organization Service.
Editing the solution files.
The 3 key entities involved here are
CustomAPI
CustomAPIRequestParameter
CustomAPIResponseProperty
Let us try creating a CustomAPI through the maker portal.
Create a new solution, and click on New and select Custom API
Let us start with a very basic custom action.
Unique Name
This will be the name of the message. Should have the prefix same as solution’s publisher.
Name
The name of the Custom API will show up inside the solution
Display Name
Localized display name of the Custom API
Description
Localized description of the Custom API
Binding Type
Value: 0 Label: Global
Value: 1 Label: Entity
Value: 2 Label: EntityCollection
Bound Entity Logical Name
Logical name of the entity in case of binding type – Entity and EntityCollection.
Is Function
Value: 0 Label: No
Value: 1 Label: Yes
Allowed Custom Processing Step Type
Value: 0 Label: None Meaning: No custom processing steps allowed.
Value: 1 Label: Async Only Meaning: Only asynchronous custom processing steps allowed
Value: 2 Label: Sync and Async Meaning: No restriction. 3rd party plug-ins can add synchronous logic to change the behavior of the message
Execute Privilege Name
Name of the Privilege that is required for the execution of the Custom API.
Plugin Type
Reference of the plugin registered for the Custom API
So right now we have a very basic custom API registered of Global type, which doesn’t allow any steps to be registered and doesn’t need any privileges to execute
Let us write a sample plugin and associate with this new message.
Let us register the assembly
Now let us go back to our Custom API record and associate the Plugin registered.
Let us trigger the plugin by calling the Custom API through the Postman.
Let us check the plugin trace log inside Dynamics 365 App.
Originally posted on CRM & Coffee: Hello team, This week I have been working with Certificates a LOT, and let me tell you, it’s a world on its own, I always had a lot…
Originally posted on 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,…
Originally posted on Ricky Safford Development Repository: Please remember to reschedule these maintenance jobs after the installation of CRM is completed. Maintenance Job Name Purpose Default Frequency/ Recommendation Deletion Service The deletion service maintenance…
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 … Continue reading “Manage Dynamics 365 Web API with Azure API Management”
Navigate to Settings -> Features and turn on the Relevance Search
This places the search bar in the header, making it easy to access while navigating across different pages.
With Relevance search turned off à
On clicking the search icon à we are navigated to the categorized search page.
The search result for the term “alex” with Relevance Search on–
Even before we can enter our query in the search box, the search box displays the recent terms (seems like max 3) used for search along with recent records (seems like max 6) accessed.
Provides increment search or real-time suggestions while we are tying the search term
Originally posted on CRM & Coffee: Hello team, This week I have been working with Certificates a LOT, and let me tell you, it’s a world on its own, I always had a lot…
Originally posted on 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,…
Originally posted on Ricky Safford Development Repository: Please remember to reschedule these maintenance jobs after the installation of CRM is completed. Maintenance Job Name Purpose Default Frequency/ Recommendation Deletion Service The deletion service maintenance…
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 … Continue reading “Manage Dynamics 365 Web API with Azure API Management”