Redirect to new tab/Window

kittu1
Giga Contributor

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.

1 ACCEPTED SOLUTION

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


View solution in original post

10 REPLIES 10

ohhgr
Kilo Sage
Kilo Sage

Hi Vamsee,



Is "Search Duplicates" a UI Action? You could use the action.setRedirectURL() function.



Thanks,
Mandar


kittu1
Giga Contributor

Hi Mandar,


It's a UI Action, tried action.setRedirectURL but did not work. Any thoughts or suggestions.



Thanks,


Vamsee.


Hi Vamsee,



Could you try removing the "sysparm_stack=no" parameter from your URI.



Thanks,
Mandar


kittu1
Giga Contributor

Removed "sysparm_stack=no" but no luck.