Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Power Apps Pro Dev & ISV
Unanswered

Help with Custom Control (PCF) Code ?leak?

(0) ShareShare
ReportReport
Posted on by

Hi All!

First of all, i hope you are having a good time, according with the current crisis , of course.
I'm having a splitting headache with i think it will be a really silly problem, which am going to explain down below.

I've created a PCF to "Replace" a "Choice" field with what is basically the same think But when the option is equal to a configured target, it changes color to all user's attention. it works fine on my machineâ„¢, so i uploaded to our D365 Org. Actually Works! Until you navigate out from the form and open another record from the same table (which indicates had a problem loading, print below). Does anybody got this before? this is not the first time it happened, but i just abandoned the idea and replace it with an WebResource. so it looks that i do something consistently wrong. Other PCFs (from PCF Gallery) Work just fine.


you can find the code here: https://github.com/numsantos/Color-Field-PCF

 

and the prints with the Error (Could not fin/invke Xrm.Sparkfish.PCF.ColorField's constructor):

numsantos_0-1620233994191.png

 

Prints of it Working and then not working by navigating back to the accounts view and again to a record:

 

numsantos_2-1620234125894.png

numsantos_1-1620234121319.png

 

Does anybody finds what is wrong in the code ?

  • cchannon Profile Picture
    4,702 Super User 2025 Season 1 on at
    Re: Help with Custom Control (PCF) Code ?leak?

    From a quick glance through, I see two things:
    - One, you are redundantly calling render. If you have it in updateView, there is no reason to call it in init.

    - Two (and much more important), your html injection in the tsx is crazy. You're trying to reproduce MSFT html and it is bound to bite you in the butt. You will find it MUCH easier and MUCH MUCH safer to use Fluent UI React Components to build things like an optionset. Try this one: Home - Fluent UI (microsoft.com)

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Power Apps - Power Apps Pro Dev & ISV

#1
WarrenBelz Profile Picture

WarrenBelz 55 Most Valuable Professional

#2
mmbr1606 Profile Picture

mmbr1606 42 Super User 2025 Season 1

#3
Michael E. Gernaey Profile Picture

Michael E. Gernaey 31 Super User 2025 Season 1

Overall leaderboard