Showing results for 
Search instead for 
Did you mean: 
New Member

Programmatically register PCF



Is there any way to Programmatically register PCF control on entity?




FYI, i am able to add this control on sub grid of form by modifying form xml programatically. 

Thanks in advance..

Solution Sage
Solution Sage

Unless (or until) things change a Powerapp / D365 form is just an XML document which is rendered by the PowerApp / D365 system into the form you see on the page (from memory the page the xml conversion used to be done on the server but with the unified interface it is now rendered within the browser using Javascript).


Given that you specify the type of control a field in the form editor I suspect the only way programmatically add the control to the form would be to changing the XML of the form programmatically - how to do that is probably worthy of some research and a blog post of 3 for someone with the time and inclination to do so as doing it incorrectly will result in an invalid page.

If this post has answered your question please consider it for "Accept as Solution" or if it has been helpful give it a "Thumbs Up".
Power Apps
Power Apps

You can  configure the control to the relevant field and then look at the change in the custom control configurations to the form XML. This configuration binds the field to the custom control and right form factor. Directly modifying the formXML will work but bypass any validations  like control missing from CDS. 



I want to add PCF control  at entity level as shown in above screenshot.


By modifying form xml we can add PCF control on field or on Sub grid.


Is there any way, we can modify entity xml programmatically.



That wasn't what you asked for in the original question you talked about forms.


In this case can I ask what your actual use case is?


Programmatically changing things as @HemantG points out bypasses all the security checks built into the front end of D365 / Powerapps which is fine when the worst thing you can do is break part of a form, but when replacing the entity's default control will cause a lot of problems if the control does not exist, is invalid / broken or were you to try and move the entity to another solution.


That's not to say you cannot try and do it I just really can't see any advantage and a lot of disadvantages in what you want to do. You would be better off creating a solution that contains both the PCF control and the top level entity details of the entities you want the control on and moving the solution around in sync.

If this post has answered your question please consider it for "Accept as Solution" or if it has been helpful give it a "Thumbs Up".

Helpful resources

PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

PowerPlatform 768x460.png

Microsoft Learn

Check out our new Discover Your Career Path blog post series and get all the details.

Users online (1,396)