What objects are available to the script field on an order guide?

Bryan Cole2
Giga Contributor

Does anyone know what objects are available to the script field on an order guide?

ServiceNow recommended I script the logic I need since the base rules don't support checks against user.roles. I need to figure out a way to check the current variable values, before determining what items to add to the order guide.

6 REPLIES 6

sachin_namjoshi
Kilo Patron
Kilo Patron

In you are talking about conditions in rule base, then you can use server side objects in condition of rule base.

Also, it depends on your order guide variables.

e.g if you have reference variable in order guide, you can use this reference variable with advanced qualifier condition to call script include in your rule base condition.

Take a look below for advance reference qualifier

https://docs.servicenow.com/bundle/orlando-platform-administration/page/script/server-scripting/conc...

 

Regards,

Sachin

Hi Sachin, thanks for taking the time to reply. I'm not referring to the conditions in the rule base, I'm talking about the script on the order guide itself.

You can configure catalog client scripts on order guide and from client script you can use GlideAjax as well.

 

Regards,

Sachin

Ishita Shrivast
Kilo Guru

Hi Bryan, "guide" is the object that can be used in the script field of order guide

The script field in an order guide can be used to add or remove catalog items to or from the order guide. It can be added to the order guide form by configuring the form layout.

  • To add a catalog item that is not added to the order guide via a rule base, write the following code in the script field:
<source lang="javascript">

guide.add(“<sys_id_of_cat_item>") </source>

  • To remove a catalog item that is added to the order guide via a rule base, write the following code in the script field:
<source lang="javascript">

guide.remove(“<sys_id_of_cat_item>") </source>

 

Hope this helps. Please mark it as correct and helpful, if applicable.

Thanks and Regards,

Ishita Shrivastava.