- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-22-2025 07:40 AM
Hi Team,
I want to remove mandatory from Resolution Notes when we are closing or resolving the case.
I just want Resolution Code to be mandatory.
I guess we have a UI Policy and Client Script.
UI Policy:
Below is the UI Policy,
On this UI Policy I just made mandatory to Leave Alone
Client Script:
function onSubmit() {
var submitAction = g_form.getActionName();
//If "Close Case" or "Propose Solution" actions are triggered
if(submitAction == "close" || submitAction == "proposeSolution"){
if(submitAction == "close" && g_form.hasField("closed_by"))
g_form.setValue('closed_by', g_user.userID, g_user.userName);
if(submitAction == "proposeSolution" && g_form.hasField("resolved_by"))
g_form.setValue('resolved_by', g_user.userID, g_user.userName);
//Validate if Close Notes & Resolution Code are populated
if((g_form.hasField("close_notes") && g_form.getValue("close_notes") == "") || (g_form.hasField("resolution_code") && g_form.getValue("resolution_code") == "")){
if(submitAction == "proposeSolution"){
g_form.addErrorMessage(getMessage('To propose a solution, you must select a resolution code'));
// g_form.addErrorMessage(getMessage('To propose a solution, you must select a resolution code and add resolution notes.'));
}else{
g_form.addErrorMessage(getMessage('To close a case, you must select a resolution code'));
// g_form.addErrorMessage(getMessage('To close a case, you must select a resolution code and add resolution notes.'));
}
if(typeof g_tabs2Sections !== 'undefined'){
var tabIndex = g_tabs2Sections.findTabIndex('close_notes');
if(tabIndex > -1){
g_tabs2Sections.setActive(tabIndex);
g_tabs2Sections.markTabMandatoryByField('close_notes');
}
}
// g_form.hideFieldMsg('close_notes');
g_form.hideFieldMsg('resolution_code');
if(g_form.getValue("resolution_code") == ""){
g_form.showFieldMsg('resolution_code', getMessage('Resolution code is required.'), 'error', false);
}
/* if(g_form.getValue("close_notes") == ""){
g_form.showFieldMsg('close_notes', getMessage('Resolution notes are required.'), 'error', false);
} */
return false;
}
}
}
whatever is there in the comments, I have commented that for making resolution notes as non mandatory.
The result, when I am closing the case It is not showing as mandatory for Resolution Notes, However, it is not allowing to submit the case, it is showing below error message
Even I have selected Resolution code, but still it is showing the same
Any help what I am doing wrong
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-22-2025 07:57 AM
Hi @Gopal14 ,
function onSubmit() {
var submitAction = g_form.getActionName();
//If "Close Case" or "Propose Solution" actions are triggered
if (submitAction == "close" || submitAction == "proposeSolution") {
if (submitAction == "close" && g_form.hasField("closed_by"))
g_form.setValue('closed_by', g_user.userID, g_user.userName);
if (submitAction == "proposeSolution" && g_form.hasField("resolved_by"))
g_form.setValue('resolved_by', g_user.userID, g_user.userName);
//Validate if Close Notes & Resolution Code are populated
if ( /*(g_form.hasField("close_notes") && g_form.getValue("close_notes") == "") ||commented this*/ (g_form.hasField("resolution_code") && g_form.getValue("resolution_code") == "")) {
if (submitAction == "proposeSolution") {
g_form.addErrorMessage(getMessage('To propose a solution, you must select a resolution code'));
// g_form.addErrorMessage(getMessage('To propose a solution, you must select a resolution code and add resolution notes.'));
} else {
g_form.addErrorMessage(getMessage('To close a case, you must select a resolution code'));
// g_form.addErrorMessage(getMessage('To close a case, you must select a resolution code and add resolution notes.'));
}
/*
commented this if block too but you can enable it if you want from 21 to 30
if (typeof g_tabs2Sections !== 'undefined') {
var tabIndex = g_tabs2Sections.findTabIndex('close_notes');
if (tabIndex > -1) {
g_tabs2Sections.setActive(tabIndex);
g_tabs2Sections.markTabMandatoryByField('close_notes');
}
}
*/
// g_form.hideFieldMsg('close_notes');
g_form.hideFieldMsg('resolution_code');
if (g_form.getValue("resolution_code") == "") {
g_form.showFieldMsg('resolution_code', getMessage('Resolution code is required.'), 'error', false);
}
/* if(g_form.getValue("close_notes") == ""){
g_form.showFieldMsg('close_notes', getMessage('Resolution notes are required.'), 'error', false);
} */
return false;
}
}
}
update your client script with above script
I have added comments the line where I have commented
Please mark my answer as helpful/correct if it resolves your query.
Regards,
Chaitanya
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-22-2025 07:57 AM
Hi @Gopal14 ,
function onSubmit() {
var submitAction = g_form.getActionName();
//If "Close Case" or "Propose Solution" actions are triggered
if (submitAction == "close" || submitAction == "proposeSolution") {
if (submitAction == "close" && g_form.hasField("closed_by"))
g_form.setValue('closed_by', g_user.userID, g_user.userName);
if (submitAction == "proposeSolution" && g_form.hasField("resolved_by"))
g_form.setValue('resolved_by', g_user.userID, g_user.userName);
//Validate if Close Notes & Resolution Code are populated
if ( /*(g_form.hasField("close_notes") && g_form.getValue("close_notes") == "") ||commented this*/ (g_form.hasField("resolution_code") && g_form.getValue("resolution_code") == "")) {
if (submitAction == "proposeSolution") {
g_form.addErrorMessage(getMessage('To propose a solution, you must select a resolution code'));
// g_form.addErrorMessage(getMessage('To propose a solution, you must select a resolution code and add resolution notes.'));
} else {
g_form.addErrorMessage(getMessage('To close a case, you must select a resolution code'));
// g_form.addErrorMessage(getMessage('To close a case, you must select a resolution code and add resolution notes.'));
}
/*
commented this if block too but you can enable it if you want from 21 to 30
if (typeof g_tabs2Sections !== 'undefined') {
var tabIndex = g_tabs2Sections.findTabIndex('close_notes');
if (tabIndex > -1) {
g_tabs2Sections.setActive(tabIndex);
g_tabs2Sections.markTabMandatoryByField('close_notes');
}
}
*/
// g_form.hideFieldMsg('close_notes');
g_form.hideFieldMsg('resolution_code');
if (g_form.getValue("resolution_code") == "") {
g_form.showFieldMsg('resolution_code', getMessage('Resolution code is required.'), 'error', false);
}
/* if(g_form.getValue("close_notes") == ""){
g_form.showFieldMsg('close_notes', getMessage('Resolution notes are required.'), 'error', false);
} */
return false;
}
}
}
update your client script with above script
I have added comments the line where I have commented
Please mark my answer as helpful/correct if it resolves your query.
Regards,
Chaitanya
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-22-2025 08:35 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-22-2025 09:25 AM
Hi @Gopal14 ,
Check if there is any BR or within UI action any other functionality which is throwing that error
Please mark my answer as helpful/correct if it resolves your query.
Regards,
Chaitanya

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-15-2025 02:13 AM
Hey Chaitanya,
I had the same issue.
You also have to modify the Script in the State Flows for the Case table. For Resolved State and Close State.