- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-05-2020 12:34 PM
Hi Team,
I have a clarification that am putting forth to our expert snow family.
So, i have a Business rule and am calling a Script Include from BR.
Will current.sys_id work on SI for further usage without even passing the current object to BR on the function call.
Note - I did this, and seems to be working fine, i passed current.sys_id , on the SI function, say callingSI(current.sys_id).
Now on SI , i have it like this callingSI(){
//still accessing current.sys_id
var gr=new GlideRecord('talename');
gr.addQuery('sys_id',current.sys_id);
---
---
}
Will this work.
Thanks,
Iniya
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-05-2020 01:10 PM
Hello Inya,
Since you are calling SI from BR, the SI instantiated in the BR itself and hence current will be available in the SI.
Mark the comment as a correct answer and helpful if it answers your question.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-05-2020 01:13 PM
you can do something like below
Business Rule:
new callingSI(current.sys_id);
SI:
callingSI(sysid){
//still accessing current.sys_id
var gr=new GlideRecord('talename');
gr.addQuery('sys_id', sysid);
---
---
}
you can also do below
Business Rule:
new callingSI(current);
SI:
callingSI(gr){
gs.print(gr.number);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-05-2020 09:38 PM
Hi Mike Patel,
Thanks for your response.
Actually even though am passing the current.sys_id on BR, but in SI i fail to get that through function, instead i directly start using on SI as current.sys_id and still seeem to work fine far, but was worried if its right.
I do this :
new callingSI(current.sys_id);
SI:
callingSI(<empty>){
//still accessing current.sys_id
var gr=new GlideRecord('talename');
gr.addQuery('sys_id', current.sysid);
Thanks,
Iniya

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-06-2020 05:28 AM
Best practice is to use variable instead of current like I mentioned in my script.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-09-2024 01:49 PM
For me the current.getUniqueValue() worked perfectly.