Populate a field when a UI action button is clicked

Rachael12
Tera Contributor

Hello,

In knowledge article, when Retire is clicked manually I want that a new field should be displayed and made mandatory.

So within OOB UI action Retire, I made below changes :

Client : checked
onclick : onCLickFunction();
Within Workspace added below code
function onClick(g_form) {
g_form.setVisible('u_retire', true);
g_form.setMandatory('u_retire', true);
}

Did not make any changes in Script. The UI is not working now.

Could you please suggest how to achieve the requirement.

Thanks in advance!

3 REPLIES 3

Paul Curwen
Giga Sage

In the Onclick field on your UI Action you should have the following text only: onClick();

In your text example above (unless it is a typo) you have called your function 'Onclick' not 'OnClickFunction'

 

Also I am presuming the button is appearing in Workspace and you have the Workspace Form Button filed checked

find_real_file.png

***If Correct/Helpful please take time mark as Correct/Helpful. It is much appreciated.***

Regards

Paul

Thanks for your response!

Yes, the function is mentioned as 'onClick();' and Work Space from button is checked but still the UI action is not working.

Should the button display code lines be added in the script codes?

Or any changes that will help achieve the requirement.

 

Thanks!

Aishwarya Thaku
Tera Expert
Tera Expert

Hi @Rachael ,

 

Please check if there is any client script on 'u_retire' that is creating the conflict.

 

Thanks,

Aishwarya