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..
Comparing Web Resources (JavaScript) Across Multiple Dataverse Environments Using a Console App by Nishant Rana
August 26, 2026 We recently refactored a large JavaScript solution — replacing a number of deprecated methods with their supported equivalents, along with some performance improvements — the kind of change that touches a lot of files without changing what any of them are actually supposed to do. That solution needed …
Continue reading “Comparing Web Resources (JavaScript) Across Multiple Dataverse Environments Using a Console App”
Power Platform Environment Not Showing Up in Maker Portal & Power Platform Admin Center (Dataverse / Dynamics 365) by Nishant Rana
August 25, 2026 Recently, we ran into an interesting issue while working with a Dynamics 365 / Dataverse environment. Even though the user was assigned the System Administrator security role, the environment did not appear in either the Power Platform Admin Center or the Maker Portal. The surprising part was that …
Continue reading “Power Platform Environment Not Showing Up in Maker Portal & Power Platform Admin Center (Dataverse / Dynamics 365)”
SQL4CDS UTC Mode: Converting Advanced Find Date Filters to UTC Boundaries– A Quick Reference (Dataverse / Dynamics 365) by Nishant Rana
August 5, 2026 While validating record counts for a Work Orders view in Dynamics 365 Field Service, we ran into the same underlying issue covered in an earlier post – Why SQL4CDS Record Counts May Not Match Advanced Find for Date Filters. This time, instead of just explaining the root cause …
Continue reading “SQL4CDS UTC Mode: Converting Advanced Find Date Filters to UTC Boundaries– A Quick Reference (Dataverse / Dynamics 365)”
Hide Expired Sessions in Event Registration Form using JavaScript (Dynamics 365 Customer Insights – Journeys) by Nishant Rana
August 4, 2026 One of our recent requirements was to ensure that users could no longer register for event sessions once the session had already ended. The goal was to improve the user experience by hiding expired sessions from the Event Registration form, rather than displaying sessions that were no longer …
Continue reading “Hide Expired Sessions in Event Registration Form using JavaScript (Dynamics 365 Customer Insights – Journeys)”
When Entity.Id Is Guid.Empty with QueryExpression.Distinct = True (Dataverse) by Nishant Rana
July 29, 2026 While optimising the performance of a Dataverse plugin, we noticed a QueryExpression using ColumnSet(true). The business logic only required a few attributes, so replacing ColumnSet(true) with a minimal ColumnSet looked like an easy performance improvement. The query also used Distinct = true, which we left unchanged because it …
Continue reading “When Entity.Id Is Guid.Empty with QueryExpression.Distinct = True (Dataverse)”
Implementing Cloudflare Turnstile for Dynamics 365 Customer Insights – Journeys Real-Time Marketing Forms by Nishant Rana
July 28, 2026 Check the previous posts for more details – In one of our recent projects, we implemented Cloudflare Turnstile (Invisible) for a Dynamics 365 Customer Insights – Journeys Real-Time Marketing form. In this post, we’ll look at how to configure Cloudflare Turnstile, integrate it with the marketing form using …
Continue reading “Implementing Cloudflare Turnstile for Dynamics 365 Customer Insights – Journeys Real-Time Marketing Forms”
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#”
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”