Need to create Catalog UI Policy with a dot-walked condition from a Record producer (and workaround PRB647552 - [Catalog UI Policy] Dot walked condition not working)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-17-2016 01:28 PM
There is a known issue: PRB647552 - [Catalog UI Policy] Dot walked condition not working
I asked SN Support for the workaround and got the following suggestion:
"It sounds like you may need to construct a script using GlideRecord to lookup the checkbox value in the Company and then set the Record Producer variable".
Can anyone help me to do it?
Basically, I just need to create UI Policy with the following condition:
If
Company=>Company fields
24/7 is True
Catalog UI Policy Actions
Variable Name <field name> Visible = True
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-17-2016 01:32 PM
Hi Dmitry,
In that case I would recommend you to create a catalog client script and hide/show the variable.
You can refer OOTB client script on incident table "Set Location to user" for reference on how to pull referenced table field. Once you get the output then hide the field as per logic.
Creating a Catalog Client Script - ServiceNow Wiki
The other option is to make a GlideAjax call from script and then get the output at client side.
http://wiki.servicenow.com/index.php?title=GlideAjax#gsc.tab=0
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-17-2016 01:35 PM
Better would be to write Client Script with glide record
on load client script-
var gr= new GlideRecord('core_company');
gr.addQuery('name', <value selected in catalog form>);
gr.addQuery('24/7','true');
gr.query();
if(gr.next)
g_form.setVisible(<variable_name>, true);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-17-2016 01:38 PM
FYI, I would not recommend GlideRecord calls from client script. The best practice is to make GlideAjax calls.
Client Script Best Practices - ServiceNow Wiki
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-17-2016 01:40 PM
Yah I know that! I suggested this because suggestion of creating glideRecord is provided by SN Support.
