web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Help with Custom Contr...
Power Apps
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 ?

I have the same question (0)
  • cchannon Profile Picture
    4,702 Moderator on at

    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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 494

#2
WarrenBelz Profile Picture

WarrenBelz 352 Most Valuable Professional

#3
11manish Profile Picture

11manish 323

Last 30 days Overall leaderboard