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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Inserting a style sheet into the form

(0) ShareShare
ReportReport
Posted on by 347

I added a javascript as webresource to the form and loaded a css file using the jscript

function load_css_file(filename){
var fileref = document.createElement("link")
fileref.setAttribute("rel", "stylesheet")
fileref.setAttribute("type", "text/css")
fileref.setAttribute("href", filename)
document.getElementsByTagName("head")[0].appendChild(fileref)
}

function myFormOnLoad(){
load_css_file('/WebResources/new_header.css');
}


This loads the css file and adds it to the head

In the css I am trying to modify the font color of the "Stages" in a business process 

.processControlContainer span.stageNameContent {
color: yellow !important;
font-weight: bolder !important;
}


But since the business process stages is in a different iframe, these styles are not getting applied to that. How can I achieve this?

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Mahendar Pal Profile Picture
    45,095 on at

    Hello,

    There is no supported way of doing this, And css web resources are not for entity form, they should be used for your custom html pages.

    If you want to do it using unsupported, you need to manipulate DOM

    Thanks

  • Suggested answer
    Sayhaitokumar Profile Picture
    7,042 on at

    Hi Vicky,

    It's is not supported by CRM, if you wanna make make it you need to go with DOM

  • svignesh Profile Picture
    347 on at

    Hello,

    Thanks for the information.

    is it not supported in CRM 2016 or its not supported right from 2011 version ?

  • Suggested answer
    Mahendar Pal Profile Picture
    45,095 on at

    It was never supported to use css for entity forms, I will suggest you to refer what is supported in CRM: msdn.microsoft.com/.../gg328350.aspx

    Thanks

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans