Workspace UI Action not saving
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-21-2022 08:36 AM
I have created a new UI Action for the workspace that changes the state of the case to closed and populate the resolved by and the resolved date but it doesn't save the record after clicking the button.
Here is the code I have written:
function onClick(g_form) {
if (g_form.getValue('close_notes') == "") {
g_form.hideFieldMsg('close_notes');
g_form.showFieldMsg('close_notes', 'Please give a resolution note.', 'error');
g_form.addErrorMessage("resoloution notes field is empty");
}
if (g_form.getValue('resolution_code') == "") {
g_form.hideFieldMsg('resolution_code');
g_form.showFieldMsg('resolution_code', 'Please choose a resolution code.', 'error');
g_form.addErrorMessage("resoloution code field is empty");
}
if ((g_form.getValue('resolution_code') && g_form.getValue('close_notes')) != "") {
g_form.setValue('state', '3');
g_form.setValue('resolved_by', g_user.userID);
g_form.setValue('resolved_at', formatDate(new Date(), g_user_date_time_format));
g_form.save();
}
}
- Labels:
-
Agent Workspace

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-21-2022 10:20 AM
Hope you have checked Client checkbox in the UI action form. Also check if all the mandatory fields are filled before form gets submitted.
Aman Kumar

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-15-2022 12:52 PM
Hey,
Didn't hear back on this.
Is your issue resolved? If yes, feel free to mark helpful/correct, so it will be helpful for others looking for similar query.
Aman Kumar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-31-2023 01:15 AM
Hi Misgana
Did you get any solution for this.
I am also facing the same issue. The worknotes are getting updated but the state is not changing.