When dealing with multiple scopes how to decide in which scope the configuration should be created.

Rohit_Singh_19
Tera Contributor

I need to know the best practice to select the scope in which the configuration needs to be created. Suppose I am working in HR Scope and I need to create a business rule within that I need to access data from User table which is Global Scope. Then what should the best approach to deicide the same.

 

Thanks!   

1 ACCEPTED SOLUTION

Chaitanya ILCR
Mega Patron

Hi @Rohit_Singh_19 ,

 

Always make the changes in the scope where the enhancements are requested if they are allowed. 

in some cases you can't create files in the different scopes because of the access policies of the table.

 

In this case create the BR in the HR Scope.

 

 

Please mark my answer as helpful/correct if it resolves your query.

Regards,
Chaitanya

View solution in original post

6 REPLIES 6

Chaitanya ILCR
Mega Patron

Hi @Rohit_Singh_19 ,

 

Always make the changes in the scope where the enhancements are requested if they are allowed. 

in some cases you can't create files in the different scopes because of the access policies of the table.

 

In this case create the BR in the HR Scope.

 

 

Please mark my answer as helpful/correct if it resolves your query.

Regards,
Chaitanya

TejasSN_LogicX
Tera Contributor

Hi @Rohit_Singh_19 ,

Accessing tables outside your scope (like sys_user in Global scope) is allowed,Scoped apps can read/write data in Global scope by default,  with proper role  and permission 

 

if you ar using the business rule then you have to use the GlideSercure() not GlideRecord() . if  you dont wanna check ACL and directly access the data then you can use Gliderecord()

 

If multiple scoped applications need the same Global table logic, wrap it in a Script Include. Make the Script Include public or accessible from other scopes if needed.

 

 

Best way to create the Script include in "global" scope . write you logic in script include .Make the Script Include public or accessible from other scopes if needed.

and then call this script include from your scope application 

 

If you found my solution helpful, please mark it as Helpful or Accepted Solution...!

thanks,

tejas

Email: adhalraotejas1018@gmail.com

LinkedIn: https://www.linkedin.com/in/tejas1018

 

 

 

 

Dominik Simunek
Tera Guru

The fact that you need "User" data alone is not a valid argument to build your BR in the global scope. Various app scopes access and rely on other scope data (like user) and it is managed in cross scope policies etc. So I would say you create it in the scope of the app where your functionality belongs to (e.g., if it is a logic on HR Case, it would be HR scope), or you have a dedicated custom scope for such customizations (maybe something like HR Core Enhancements). But this might depend on your governance and guidelines for customizations within your environment, and your architect(s) should give you the guidance concrete for it.

Dr Atul G- LNG
Tera Patron

Hi @Rohit_Singh_19 

 

https://www.servicenow.com/docs/bundle/washingtondc-application-development/page/build/applications/...

 

https://www.servicenow.com/community/s/cgfwn76974/attachments/cgfwn76974/architect-forum/4325/1/Deve...

 

*************************************************************************************************************
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/dratulgrover [ Connect for 1-1 Session]

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