The CreatorCon Call for Content is officially open! Get started here.

Confusion between business rule use and client script use

PriyanshuVerma1
Tera Expert

Hey everyone,

I have doubt about business rule and client script usage.

I have a requirement to add a logic to change records such that if change task has any change task open, change record can't move to "implemented" state from 'implement' state.

To move to implemented state user has to click an ui action button "Implemented" on change record header.

Now, my doubt is what should i use business rule or client script to achieve this as i am not very through with usage of both of these

8 REPLIES 8

Anurag Tripathi
Mega Patron
Mega Patron

Hi,

 

If the only way to do Move to implementation state is via that UI action, then you should validate it in the UI action, One UI Action can serve as Client & Server both.

If there are more ways then it depends , if it is always initiated on the form then you can use client scripts, if not then BR is the way to go.

-Anurag

Dr Atul G- LNG
Tera Patron
Tera Patron

Hi @PriyanshuVerma1 

 

Guru @Anurag Tripathi already provided solution but my thoughts

BR : When you need some action at Database level ( may be after some action or before )

client Script: When you want immediate check without going Database and show on form.

*************************************************************************************************************
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]

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

AndersBGS
Tera Patron
Tera Patron

Hi @PriyanshuVerma1 ,

 

I would always chose a business rule over client script, as it doesn't impact the performance client side. Remember that client scripts runs client side where business rule runs server side. 

 

If my answer has helped with your question, please mark my answer as accepted solution and give a thumb up.

 

Best regards

Anders

If my answer has helped with your question, please mark my answer as the accepted solution and give a thumbs up.

Best regards
Anders

Rising star 2024
MVP 2025
linkedIn: https://www.linkedin.com/in/andersskovbjerg/

Sandeep Rajput
Tera Patron
Tera Patron

@PriyanshuVerma1 Why do you need to write a business rule/client script for this when you can check this on UI Action script field itself?