Workspace Redirect Url Does not Work

Anisse Mahtat
Tera Contributor

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: 

ScriptA.PNG

and i have this error in my console when i click on the button

ErrorC.PNG

But if i take the url and i open a new window and i paste the url, i am on the good page

2 ACCEPTED SOLUTIONS

Hi,

I have tested this and it is working fine for me in both UI.

Screenshot 2023-12-26 at 5.11.40 PM.png

 

Screenshot 2023-12-26 at 5.11.17 PM.png

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).

 

Please appreciate the efforts of community contributors by marking appropriate response as correct answer and helpful, this may help other community users to follow correct solution in future.
Thanks
Anil Lande

View solution in original post

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.

 

 

Please appreciate the efforts of community contributors by marking appropriate response as correct answer and helpful, this may help other community users to follow correct solution in future.
Thanks
Anil Lande

View solution in original post

17 REPLIES 17

Hi,

I have tested this and it is working fine for me in both UI.

Screenshot 2023-12-26 at 5.11.40 PM.png

 

Screenshot 2023-12-26 at 5.11.17 PM.png

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).

 

Please appreciate the efforts of community contributors by marking appropriate response as correct answer and helpful, this may help other community users to follow correct solution in future.
Thanks
Anil Lande

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)WorkspaceRes.PNG

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.

 

 

Please appreciate the efforts of community contributors by marking appropriate response as correct answer and helpful, this may help other community users to follow correct solution in future.
Thanks
Anil Lande

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.

 

Please appreciate the efforts of community contributors by marking appropriate response as correct answer and helpful, this may help other community users to follow correct solution in future.
Thanks
Anil Lande

Yes, that's work thanks, i have to add my field Contract to the Workspace IUB view for my hr case @Anil Lande