How can you reload the form in an agent workspace client script?

e_wilber
Tera Guru

On one of our agent workspace forms we have a UI action that, when clicked, sets some field values and should allow two other UI actions to show up on the form. The button works in the native form view but not agent workspace and I think it's because the form isn't actually reloading in workspace.

The script in use for the worksplace client script is:

function onClick(g_form) {

}

and I have tried using reloadWindow(window); as well as location.reload() and g_form.save() and g_form.submit() without success. It looks like it just saves the form as-is but doesn't refresh the form to allow other UI actions to appear on the form.

Any idea how to do this?

2 REPLIES 2

Kiranmai_KVL
Kilo Sage

Hello,

Instead of location.reload(), can you try  g_form.reload(); ?

Best Regards,

Kiranmai

Alexander Ander
Tera Contributor

Building on Kiranmai's reply, you would need to enable "Client" on the UI Action and add a reload in the workspace client script;

 

Client Checkbox:

find_real_file.png

Workspace Script:

find_real_file.png

function onClick(g_form) {
	g_form.reload();
}