Is there a way to change the banner colour for specific records

alabbas
Tera Contributor

Hi,

 

I have a requirement to change the colour of the banner for when someone opens a major incident record.

I cant seem to find a way without doing it for everything.

 

Worst case we can have the field 'major_incident_type' another colour when state is accepted or proposed.

 

I tried field style but it doesnt work. Am I missing something with my client script?

 

Thanks

3 REPLIES 3

Mark Manders
Mega Patron

You can't change the color of the banner for just a certain record. The banner isn't task(type) related.


Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark

Dr Atul G- LNG
Tera Patron
Tera Patron

Hi @alabbas No, that's not possible. However, you can create the announcements instead.

*************************************************************************************************************
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.

Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]

****************************************************************************************************************

Juhi Poddar
Kilo Patron

Hello @alabbas 

  • Changing the banner colour for a specific record is not possible.
  • However, if your goal is to highlight a specific field, such as changing the label colour of major_incident_type when the state is Accepted or Proposed, you can achieve this using an onChange client script.

Please refer to the script below to change the colour of the field label:

function onChange(control, oldValue, newValue, isLoading, isTemplate) {
    if (isLoading || newValue === '') {
        return;
    }
    var stateLabel = g_form.getLabel('major_incident_state');
    var stateValue = g_form.getValue('major_incident_state');
    if (stateValue == '1' || stateValue == '2') {
        stateLabel.style.color = 'red';
        stateLabel.style.fontWeight = 'bold';
    } else {
        stateLabel.style.color = 'black';
        stateLabel.style.fontWeight = 'normal';
    }
}

 The above script will check for the field value and change the colour of label if it proposed or accepted.

You can also refer this for more details: Custom field styles

Hope this helps!

 

"If you found my answer helpful, please like and mark it as an "accepted solution". It helps future readers to locate the solution easily and supports the community!"

 

Thank You
Juhi Poddar