Passing sys id from BR to Script include

Inya
Tera Contributor

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

1 ACCEPTED SOLUTION

asifnoor
Kilo Patron

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.

View solution in original post

8 REPLIES 8

sachin_namjoshi
Kilo Patron
Kilo Patron

Yes, you can use current object in script include.

your code will work.

 

Regards,

Sachin

Jaspal Singh
Mega Patron
Mega Patron

Hi Inya,

 

Yes, it will work. I suggest you to check link that has detailed explanation.

Tejas Tamboli
Giga Guru

Hello Inya,

 

Yes,

 

It will work. You can use the current objects in Script Include.

 

- When you pass it in a function call previously instantiating the class it is a part of.

 

-When you use Script Include as a function call without the class wrapper. You can then reference it as current, without having to pass it in.

 

 

hope that will help you.

Mark Correct if this solves your issue and also mark 👍 Helpful if you find my response useful to you and help others to find information faster.

Thanks,

Tejas

asifnoor
Kilo Patron

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.