Posts

Showing posts from October, 2020

WebApi - Execute Bound Function (RetrievePrincipalAccess) in PCF

Image
I am current building PCF component that required me to determine if the user has specific rights to an entity before attempting to modify it. In order to do this I needed to figure out how to do an execute request for a Function bound to an Entity. The hardest part in doing all is really figuring out the parameters and parameterTypes you need to send with the request. This Microsoft article on how to Use Web API functions . The real takeaway from this article was pulling up the CDS metadata document for the system to determine the properties. Additionally the documentation for the Xrm.WebApi.online.execute function was also useful. https://<yourorg>.crm.dynamics.com/api/data/v9.0/$metadata This document contains the function name and their input properties. After finding the function in the document i was able to determine that I needed the following properties: entity, Target. This also gave me their Types which i could use i the parameterTypes section of the request. Th