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..
AB-100 Last-Minute Revision Cheat Sheet (Microsoft Agentic AI Business Solutions Architect) by Nishant Rana
September 12, 2026 Recently, I cleared the Microsoft Certified: Architecting Agentic AI Business Solutions (AB-100) exam. While preparing, I ended up creating this one-page Architect’s Compass for my last-minute revision. Instead of memorizing every Microsoft service, I grouped similar services so I could quickly decide which one fits a business scenario. …
Continue reading “AB-100 Last-Minute Revision Cheat Sheet (Microsoft Agentic AI Business Solutions Architect)”
Column Visualizations for Grids / Views (Preview) –Dataverse / Dynamics 365 by Nishant Rana
September 10, 2026 Power Apps now lets us render a column’s data as a small graphic in the grid – a gauge, a sparkline, a colored bar, or stars – instead of plain text. We tried it out on a couple of our own columns, and here’s a quick step-by-step on …
Continue reading “Column Visualizations for Grids / Views (Preview) –Dataverse / Dynamics 365”
Business Process Flow Error: “Participating entity record of stage: X is not valid” (0x80040216) (Dynamics 365 / Dataverse) by Nishant Rana
September 8, 2026 Scenario Working on a custom multi-entity Business Process Flow (Opportunity → Quote) recently, we ran into this error while trying to reactivate the process: The BPF (custom_salesprocess) had already traversed several stages — Generate Opportunity → Qualify → Generate Quote → Initiate Deposit/Bank Guarantee → Sales Completion — …
Continue reading “Business Process Flow Error: “Participating entity record of stage: X is not valid” (0x80040216) (Dynamics 365 / Dataverse)”
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”
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”