- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-26-2023 02:21 AM
Hi,
I have a ui action for redirection url who does not work and i don't know how to do that.
I have my ui action script:
and i have this error in my console when i click on the button
But if i take the url and i open a new window and i paste the url, i am on the good page
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-26-2023 03:45 AM
Hi,
I have tested this and it is working fine for me in both UI.
Use below scripts:
function openWorkspace() {
g_navigation.openPopup("/now/hr/agent/record/sn_hr_core_contract/" + g_form.getValue('u_contract'));
}
Workspace client script:
function onClick(g_form) {
var url = "/now/hr/agent/record/sn_hr_core_contract/" + g_form.getValue('u_contract');
open(url);
}
NOTE: Make sure contract field is added on HR Case form and it is added in all Views (default and workspace).
Thanks
Anil Lande

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-26-2023 03:53 AM
That means your HR Case view does not have Contract field on the form. It must be in backend, Add it to form by configuring form layout.
Thanks
Anil Lande

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-26-2023 03:45 AM
Hi,
I have tested this and it is working fine for me in both UI.
Use below scripts:
function openWorkspace() {
g_navigation.openPopup("/now/hr/agent/record/sn_hr_core_contract/" + g_form.getValue('u_contract'));
}
Workspace client script:
function onClick(g_form) {
var url = "/now/hr/agent/record/sn_hr_core_contract/" + g_form.getValue('u_contract');
open(url);
}
NOTE: Make sure contract field is added on HR Case form and it is added in all Views (default and workspace).
Thanks
Anil Lande
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-26-2023 03:50 AM
Thanks @Anil Lande for your help , now my button work, a window is open but that find a record not found (in the url i don't have the sys_id)

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-26-2023 03:53 AM
That means your HR Case view does not have Contract field on the form. It must be in backend, Add it to form by configuring form layout.
Thanks
Anil Lande

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-26-2023 03:55 AM
If you don't want to display it to user on Form then add it by form layout configuration and create one UI Policy to Hide it when form loads.
The UI action will work only when field is added on Form views.
Thanks
Anil Lande
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-26-2023 04:08 AM
Yes, that's work thanks, i have to add my field Contract to the Workspace IUB view for my hr case @Anil Lande