When Class is Application how to set the Category to Aplication

Karl F-V
Tera Contributor

Just after some advice best practice and ideas. 

 

Within Application we want to set some defaults for tables. What id like to do is set when the Category is Application the class should be application. 

I've done a business over ride for the Category to be default Application which is working when this is saved but when users change the Category i don't want the Class to be application, so i only want this to apply when the Category is application. 

 

Do you have any options looking at a business rule but happy to hear any alternate ideas suggestions ?

2 REPLIES 2

Runjay Patel
Giga Sage

Hi @Karl F-V ,

 

Best solution would be for this is writing a BR. Use this code in before BR.

// Business Rule: Set Class to Application when Category is Application
if (current.category == 'Application' && !current.class) {
    current.class = 'Application'; // Set class to Application only if class is empty
}

 

-------------------------------------------------------------------------

If you found my response helpful, please consider selecting "Accept as Solution" and marking it as "Helpful." This not only supports me but also benefits the community.


Regards
Runjay Patel - ServiceNow Solution Architect
YouTube: https://www.youtube.com/@RunjayP
LinkedIn: https://www.linkedin.com/in/runjay

-------------------------------------------------------------------------

 

In this video i have explained about Web service integration in ServiceNow like how it works, how we can configure it, what are the prerequisite and many more. I have covered below topics in this video. 1. understand Web Service. Like when and how we will use it. 2. Talked about Inbound and ...

Karl F-V
Tera Contributor

Thanks i will give this a try thought this would be the way forward.