GlideRecord

Ajai007
Tera Contributor

 

  • Can someone assist me in understanding what this code does on Servicenow?

Screenshot 2024-02-02 224640.png

2 ACCEPTED SOLUTIONS

Danish Bhairag2
Tera Sage
Tera Sage

Hi @Ajai007 ,

 

This code modifies the user source of only 2 Groups having types sys id mentioned in the add query (2nd line) from "REFOG" to "Local Integration".

 

Also according to me the 2nd line it should be addEncodedQuery() instead of addQuery()

 

Thanks,

Danish

 

View solution in original post

Premankit
Giga Expert

i agree with @Mark Roethof perspective too, finding quick answer here will give you temporary answer but you would fall in next hurdle right away. 

though script is an easy way to do things not the only way to do it. Here you are looking at a user record from the glass of group membership. The script is trying to update Source for user from “REFOG” to “Local integration” given the group membership conditions are met. 

View solution in original post

4 REPLIES 4

Abbas_5
Tera Sage
Tera Sage

Hello @Ajai007,

I guess, In the group table members make active ' false'.

 

Mark my correct and helpful, if it is helpful and please hit the thumbs-up button to mark it as the correct solution.
Thanks & Regards,
Abbas Shaik

Danish Bhairag2
Tera Sage
Tera Sage

Hi @Ajai007 ,

 

This code modifies the user source of only 2 Groups having types sys id mentioned in the add query (2nd line) from "REFOG" to "Local Integration".

 

Also according to me the 2nd line it should be addEncodedQuery() instead of addQuery()

 

Thanks,

Danish

 

Mark Roethof
Tera Patron
Tera Patron

Hi there,

 

I think the more interesting question is, what's behind your question? Since you are asking this, it seems that you have no or limited scripting knowledge. Where did you get this scripting then from? What do you want to do with it? What is your intent?

 

Kind regards,

 

Mark Roethof

Independent ServiceNow Consultant

10x ServiceNow MVP

---

 

~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

LinkedIn

Premankit
Giga Expert

i agree with @Mark Roethof perspective too, finding quick answer here will give you temporary answer but you would fall in next hurdle right away. 

though script is an easy way to do things not the only way to do it. Here you are looking at a user record from the glass of group membership. The script is trying to update Source for user from “REFOG” to “Local integration” given the group membership conditions are met.