cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
sattu
Level: Power Up

Programmatically register PCF

Hi

 

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

 

PCFImg.png

 

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

Thanks in advance..

4 REPLIES 4
ben-thompson
Level 8

Re: Programmatically register PCF

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.

Power Apps Staff HemantG
Power Apps Staff

Re: Programmatically register PCF

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. 

 

hemant 

sattu
Level: Power Up

Re: Programmatically register PCF

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.

 

Thanks

ben-thompson
Level 8

Re: Programmatically register PCF

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.

Helpful resources

Announcements
thirdimage

Coming Soon: T-Shirt Design Contest

Keep your eyes open for our upcoming T-shirt design contest!

thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

Users online (5,372)