- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-07-2014 08:10 AM
Hi,
I am trying to redirect to new page when clicked on the "Search Duplicates" button on the Knowledge form. Below is the code that I have used to redirect
gs.setRedirect("kb_find.do?sysparm_search=" + encodeURI(current.short_description) + "&sysparm_operator=IR_OR_QUERY&sysparm_order=relevancy&sysparm_stack=no&sysparm_query=sys_id!=" + current.sys_id);
I tried using the window.open() but it did not work. Can anyone please help.
Thanks,
Vamsee.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-08-2014 05:21 AM
Hi Vamsee,
Firstly you need to call this function in the onclick function field which gets displayed when you select "client", secondly current doesn't work when you select "Client" option, you can use g_form.getUniqueValue() instead of current.sys_id and g_form.getValue("short_description") instead of current.short_description.
Once you have the URL in place, I suggest that you try to navigate to it through your browser and make sure that it is navigating properly. Also alert the fields that you are using in the URL to make sure that the fields are coming up properly.
Thanks & Regards,
Hari

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-07-2014 08:22 AM
Hi Vamsee,
Please refer section 6 on this for further details
Thanks,
Pradeep Sharma
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-08-2014 04:12 AM
HI Vamsee,
You can use window method only if the "Client" option is checked in your UI action. Otherwise, you can use the action.setRedirectURL('<your_url>'). You might have the wrong URL here, so I suggest that you look into this wiki link and make sure that your URL is proper:-Navigating by URL - ServiceNow Wiki
Thanks & Regards,
Hari
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-08-2014 04:36 AM
Hi Hari,
I have used the below script with the "Client" checkbox selected. It did not work.
function kbfunc(){
var url = "kb_find.do?sysparm_search=" + encodeURI(current.short_description);
url+= "&sysparm_operator=IR_OR_QUERY&sysparm_order=relevancy&sysparm_query=sys_id!=" + current.sys_id;
window.open(url,"_blank");
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-08-2014 05:21 AM
Hi Vamsee,
Firstly you need to call this function in the onclick function field which gets displayed when you select "client", secondly current doesn't work when you select "Client" option, you can use g_form.getUniqueValue() instead of current.sys_id and g_form.getValue("short_description") instead of current.short_description.
Once you have the URL in place, I suggest that you try to navigate to it through your browser and make sure that it is navigating properly. Also alert the fields that you are using in the URL to make sure that the fields are coming up properly.
Thanks & Regards,
Hari
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-08-2014 05:54 AM
Hi Hari,
It worked. Thank you very much.
Regards,
Vamsee.