In the previous post, we created a simple custom API https://nishantrana.me/2021/01/13/use-custom-api-to-create-custom-messages-in-dynamics-365/
Let us look at its different properties starting with ExecutePrivilegeName
Execute Privilege Name attribute of custom API allows us to specify the name of the privilege that allows execution of the custom API.
Let us update the custom API and specify the privilege name.
For simplification, we have used prvCreateIncident here i.e. Create Case / Incident Privilege.
To get the Privilege name
https://%5Borgname%5D.api.crm.dynamics.com/api/data/v9.1/privileges?$select=name
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.
Hope it helps..
Custom Form Submission Validation in Dynamics 365 Customer Insights – Journeys: Inside the Validation Pipeline and the “ms_captcha_solution” Error by Nishant Rana
July 22, 2026 While implementing custom form submission validation (server side validation) for Dynamics 365 Customer Insights – Journeys Real-Time Marketing forms, we came across the following error, “Required params cannot be null or empty –ms_captcha_solutionms_captcha_typems_captcha_flow_id” after enabling the data-validate-submission attribute on the form as shown below. Setting this attribute to …
Continue reading “Custom Form Submission Validation in Dynamics 365 Customer Insights – Journeys: Inside the Validation Pipeline and the “ms_captcha_solution” Error”
Implementing Server-Side Honeypot Validation for Dynamics 365 Customer Insights – Journeys Forms by Nishant Rana
July 21, 2026 In our previous post, we implemented a simple Honeypot for Dynamics 365 Customer Insights – Journeys Real-Time Marketing forms using JavaScript.Although that prevents most automated submissions, the validation only runs in the browser. Anyone can bypass the JavaScript and submit requests directly to the server.Fortunately, Customer Insights – …
Continue reading “Implementing Server-Side Honeypot Validation for Dynamics 365 Customer Insights – Journeys Forms”
Implementing a Simple Honeypot in Dynamics 365 Customer Insights – Journeys Real-time Marketing Forms by Nishant Rana
July 8, 2026 While working with Dynamics 365 Customer Insights – Journeys Real-time Marketing Forms, we wanted to explore a simple way of reducing bot submissions. A common technique used on websites is a honeypot. The idea is straightforward: In this post, we’ll implement this using the supported Client-side Extensibility events …
Continue reading “Implementing a Simple Honeypot in Dynamics 365 Customer Insights – Journeys Real-time Marketing Forms”
Retrieve All One-to-Many Relationships and Cascade Delete Behavior for a Dataverse Table Using C# by Nishant Rana
July 7, 2026 While working on a Dynamics 365 Field Service cleanup, we needed to delete a large number of Work Order records. Before doing so, we wanted to understand exactly what would happen to the related records. Not every relationship is configured for Cascade Delete. Many use RemoveLink, which doesn’t …
Continue reading “Retrieve All One-to-Many Relationships and Cascade Delete Behavior for a Dataverse Table Using C#”
Why SQL4CDS Record Counts May Not Match Advanced Find for Date Filters (Dataverse / Dynamics 365) by Nishant Rana
June 18, 2026 While validating some Dynamics 365 Field Service data recently, we came across an interesting scenario where SQL4CDS and Advanced Find returned different record counts even though the date filters appeared to be identical. At first glance it was surprising to see different record counts being returned despite using …
Continue reading “Why SQL4CDS Record Counts May Not Match Advanced Find for Date Filters (Dataverse / Dynamics 365)”
How We Successfully Removed the Resco Woodford Managed Solution from Dynamics 365 Field Service by Nishant Rana
June 16, 2026 Recently, we needed to remove the legacy Resco MobileCRM (Woodford) managed solution from a Dynamics 365 Field Service environment. Although the uninstall initially appeared straightforward, when we attempted to uninstall the Woodford solution, Dynamics 365 displayed a list of dependencies that needed to be addressed before. The dependencies …
Continue reading “How We Successfully Removed the Resco Woodford Managed Solution from Dynamics 365 Field Service”
Unable to Delete Work Order Due to “The Time To Promised Must Be Later Than The Time From Promised” exception – Dynamics 365 Field Service by Nishant Rana
June 10, 2026 While attempting to delete a historical Dynamics 365 Field Service Work Order, we encountered the following error: Exception Message: The time to promised must be later than the time from promised. ErrorCode: -2147220891 HexErrorCode: 0x80040265 Error Details: {“errorCode”:2147746405,”message”:”The time to promised must be later than the time from …
Continue reading “Unable to Delete Work Order Due to “The Time To Promised Must Be Later Than The Time From Promised” exception – Dynamics 365 Field Service”
Open a Power Automate Flow for Edit Without Fixing Broken Connections First by Nishant Rana
June 9, 2026 While reviewing Power Automate flows recently, we ran into an issue where we could not open a flow in edit mode When opening the flow, Power Automate displayed the “This flow will connect to” screen and requested that we fix one or more connections before proceeding. In our …
Continue reading “Open a Power Automate Flow for Edit Without Fixing Broken Connections First”
Dataverse Web API: Returning Record Data During Create Using Prefer: return=representation by Nishant Rana
June 3, 2026 When creating records using the Dataverse Web API, the default behavior is to return a successful response without including the record data in the response body. A standard create request does provide access to the newly created record’s GUID through the OData-EntityId response header. However, if we need …
Continue reading “Dataverse Web API: Returning Record Data During Create Using Prefer: return=representation”
Testing the New RunJobForSandbox Option in Bulk Delete Jobs (Preview) – Dataverse / Dynamics 365 by Nishant Rana
June 2, 2026 “Edit – 25 – June – 2026 – This only applies to sandbox environments not production. Can see Microsoft updating the details. Details “ Microsoft recently introduced a preview feature for Dataverse Bulk Delete Jobs that provides additional control over bulk delete processing. One of the new options …
Continue reading “Testing the New RunJobForSandbox Option in Bulk Delete Jobs (Preview) – Dataverse / Dynamics 365”
Discover more from Nishant Rana's Weblog
Subscribe to get the latest posts sent to your email.
4 thoughts on “Execute Privilege Name (ExecutePrivilegeName) property of Custom API in Dynamics 365 / Microsoft Dataverse”