Populate a field when a UI action button is clicked
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-07-2022 02:29 AM
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!
- Labels:
-
Team Development
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-07-2022 03:18 AM
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
Regards
Paul
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-09-2022 07:20 AM
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!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-09-2022 07:40 AM
Hi
Please check if there is any client script on 'u_retire' that is creating the conflict.
Thanks,
Aishwarya