Skip to main content

Notifications

Customer experience | Sales, Customer Insights,...
Unanswered

Form on-load error

Posted on by 428

Hi, 

I have implemented colour background for a field( I know it is not supported), below is what i have written for Form on-load, it is working as expected however, i am thrown with two consecutive script error on loading the form, please help me in rectifying these:

Also we are d365 on-premise, with this code i didn't have to turn on the legacy rendering to Yes, if i do so the code doesn't work, however the errors will disappear but that was the point without turning on the legacy i wanted the code which i have now but cant get rid of errors.

The code i have written:

function Setcolour() {

var a = Xrm.Page.getAttribute("jmfloc_vulnerable").getValue();
if(a == 1)
{
window.parent.document.getElementById("jmfloc_vulnerable").style.backgroundColor = "#cc382d" ;
}
}

Errors thrown:

pastedimage1605623814215v1.png

pastedimage1605623876750v2.png

Thanks,

PS

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

New! Quick response templatesâš¡

Save time with the new custom templates!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,151 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 229,963 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans