ServiceNow Introduction to addJoinQuery() method with demo | ServiceNow addJoinQuery ()method Learn

HI All,.

Hope you are doing fine.

– In this tutorial we will be looking over one more interesting method in the ServiceNow magic world i.e. GlideRecord addJOinQuery() method.
– So what exactly does this addJoinQuerymethod do?

– From the name don’t confuse it with the actual database join, instead, it just adds the subquery so that the result set will be confined to the subquery you have defined.
– let’s look at the inputs and outputs of the method
– Input :
– table — String — Table name
– primary field — String —If other than sys_id, the primary field.
– joinTableField — String — If other than sys_id, the field that joins the tables
– Output :
– GlideQueryConditionRecords — where the relationships match.
– Example :


“`jsx
var now_GR = new GlideRecord(‘problem’);
now_GR.addJoinQuery(‘incident’, ‘opened_by’, ‘caller_id’);
now_GR.query();
“`

– You can set the glide.invalid_query.returns_no_rows system property to true to have queries with invalid encoded queries return no records.

Agenda :

– Introduction to addJoinQuery method
– Understanding the problem statement
– Understanding the Usecase for the same
– Demo

– Note: Always thoroughly test the addJoinQuery() method in the sub-Prod instance before putting it to prod as the wrong structure may lead to a colossal mess.

**Please be sure to bookmark this article and mark it as Helpful if you thought it helpful.**

Regards,

Amit Gujarathi

Technomonk Youtube: https://www.youtube.com/c/TechnoMonkAmit

Amit Gujarathi Linkedin: https://www.linkedin.com/in/amit-gujarathi-98632a175

TheTechnomonk.com : https://thetechnomonk.com/

ServiceNow Community Amit Gujarathi: https://www.servicenow.com/community/user/viewprofilepage/user-id/265565

GitHub: https://github.com/amigujarathi


servicenow,servicenow training,servicenow tutorial,servicenow tutorial for beginners,what is servicenow,servicenow basics,introduction to servicenow,what is servicenow administrator,servicenow platform,servicenow administrator training,what is servicenow platform,servicenow versions,servicenow architecture,learn servicenow,servicenow scripting,servicenow gliderecord,scripting in servicenow,servicenow business rules,what is servicenow software

technomonkadmin

View all posts

Add comment

Your email address will not be published. Required fields are marked *