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

Anil Lande
Kilo Patron

Hi @Anisse Mahtat ,

Please try below:

 

function openWorkspace() {	
	g_navigation.openPopup("/now/hr/agent/record/"+ g_form.getTableName() +"/" + g_form.getUniqueValue());  // or hardcode the table name
}

 

make your UI Action to run on "Client" by checking check box and call the function name in onClick box.

Screenshot 2023-12-26 at 4.17.28 PM.png

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

I have try this but that does not work, (i have to open the child record 'contract' in the record hr case and in my workspace ), i have nothing i stay in my page

Can you please share your UI Action configuration screenshots and script?

 

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 @Anil Lande for sure, 

My configuration: 

ConfigUIACTION1.PNG

configUIACTION2.PNG