cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ShahriatHossain
Regular Visitor

Add tab, web resource by JavaScript creating PCF component on entity form

I want to add a tab and web resource inside that tab on entity form by JavaScript creating a PCF control but not sure it's possible or not. 

 

Please suggest how to achieve it.

6 REPLIES 6
ben-thompson
Solution Sage
Solution Sage

If you want to add a tab to an entity form the only supported way of doing so is via the form designer which generates the xml file that is then rendered (via Javascript) when the form is loaded. You can in theory do it programmatically by editing the XML directly and saving those changes but I really, really would not recommend doing so and you can't do so in real time.

 

While manipulating the DOM of the entity form directly via Javascript is in theory possible (I'm aware of people that used to do it back in the olden days of on-premise environments) it would not be supported by Microsoft and could quickly go wrong if MS changed something in a subsequent release.

---
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".

Has any way to add web resource and then add resource url under that web resource  on any entity form pro-grammatically? 

As I said above you can do it via editing the XML of the form directly but you can't do it in real time and you probably, really, shouldn't do it.

 

https://docs.microsoft.com/en-us/dynamics365/customerengagement/on-premises/developer/customize-dev/... has some background  and https://docs.microsoft.com/en-us/dynamics365/customerengagement/on-premises/developer/customize-dev/... has the schema for the old on-premise version of Dynamics .And that is all the information I can find on google which tells me a lot

 

I will add 5 more things

 

1) This documentation relates to the previous release and the schema may have changed since 2017 (I know it has)

2) Microsoft have not released a more recent version which tells me MS don't want people touching it except from tools they control

3) the lack of documentation means it's perfectly  possibly that MS could argue it's no longer supported if things went wrong.

4) the xml is not validated when it is saved, it's very possible to create invalid XML that will break the form without 

5) there is a complete lack of other blog posts regarding programmatically customizing forms - which shows how few people are brave enough to do it. I'm willing to do a lot of things and even I'm not brave enough to programmatically edit form xml.

 

So I hope that answers the question on how to do it and also explains why I really don't think it's a good idea...

---
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".

Totally agree with what Ben has said  - but I'm interested in why you want to do this - what's the use case? 

Basically, I have a custom bing map functionality inject using web resource in any entity form manually following some steps. So I want to make it dynamically creating PCF component based on it. 

@ShahriatHossain 

 

Why not place the pcf control on the form in hidden mode and then unhide it when it meets the criteria? "Creating" pcf controls on the form on the fly is not possible as it would involve some dom manipulation which MS discourages.

Cheers!

Helpful resources

Announcements
User Groups Public Preview

Join us for our User Group Public Preview!

Power Apps User Groups are coming! Make sure you’re among the first to know when user groups go live for public preview.

Power Apps Community Call

Monthly Power Apps Community Call

Did you miss the call?? Check out the Power Apps Community Call here!

Power Platform ISV STudio

Power Platform ISV Studio

ISV Studio is the go-to Power Platform destination for ISV’s to monitor & manage applications post-AppSource publish.

Users online (39,383)