- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-13-2015 10:02 PM
In the below script when condition is "No" I want to display a hyperlink on the catalog form so user can click on that link.
function onChange() {
if (g_form.getValue('variables.owner') == 'Yes')
{
//g_form.setDisplay('variables.message',true);
g_form.setDisplay('variables.Name',true);
g_form.setDisplay('variables.Type',true);
}
else if(g_form.getValue('variables.owner') == 'No')
{
g_form.setDisplay('variables.Name',false);
g_form.setDisplay('variables.Type',false);
var info = 'Link: <a href="catalog_home.do?sysparm_view=catalog_default">Link</a>';
//g_form.addInfoMessage(info);
//g_form.showFieldMsg('owner',info);
}
}
But i am not able to do that using showFieldMsge.. Can you please give some suggestions
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-13-2015 10:46 PM
Try something like the following:
1) Create a UI page and lets call it Link. Your UI page just need to have the following on its html field:
<a href="catalog_home.do?sysparm_view=catalog_default">Link</a>
2) Create a catalog variable of type UI Page and reference your recently created UI page Link
And voila!
Thanks,
Berny

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-13-2015 10:12 PM
Hi Mounika,
You should not use variables prefix at client script i.e g_form.setDisplay('variables.Name',true); should be g_form.setDisplay('Name',true);
Also please go through the below thread related to hyperlinks info.
https://community.servicenow.com/thread/148121
https://community.servicenow.com/thread/166958
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-13-2015 10:45 PM
Hi Pradeep,
Even with variables prefix script is working fine. But as suggested by you i have removed it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-13-2015 10:45 PM
Hi Mounika,
One way you could do this is through a UI page.
Thanks,
Berny
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-13-2015 10:46 PM
Try something like the following:
1) Create a UI page and lets call it Link. Your UI page just need to have the following on its html field:
<a href="catalog_home.do?sysparm_view=catalog_default">Link</a>
2) Create a catalog variable of type UI Page and reference your recently created UI page Link
And voila!
Thanks,
Berny