Resolution notes in case form

Krishna142
Tera Contributor

Could someone tell me how to make "Resolution code" and "Resolution notes" of the Case form NOT mandatory?

I checked the UI Policies, but could not find the policy for that rule.

 

Krishna142_0-1706103529275.png

 

Regards

Krishna.

6 REPLIES 6

Sandeep Raj Ram
Tera Contributor

Hi @Krishna142 ,

 

Did you check if there are any client scripts that are set up to make the fields mandatory.

Hi @Krishna142,

 

Did you see my earlier response? Essentially there are 2 areas where these values are set:

- Client Script: 'Validate Resolution Information (Case)'

- UI Policy: 'Show close notes if closed or resolved'

 

See my earlier response providing the screenshot of the UI Policy.

 

To help others (or for me to help you more directly), please mark this response correct by clicking on Accept as Solution and/or Helpful.

 

Thanks, Robbie

Hello @Robbie Maybe you can help me, newb to scripting.  I'm trying to make the cause notes of the case form to be mandatory 

below is my code;

function onSubmit() {
  var submitAction = g_form.getActionName();
  //If "Close Case" or "Propose Solution" actions are triggered

  // Add check for account QRO
  var account = g_form.getValue("account");

  //alert('This is Company Field Value: ' + account);

  // Only apply the script if the account is QRO
  if (account === "3115ed14878c52100caced370cbb3565") {
    // 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 Cause Notes are populated
      if (g_form.hasField("cause") && g_form.getValue("cause") == "") {
        if (submitAction == "proposeSolution") {
          g_form.addErrorMessage(
            getMessage("To propose a solution, you must put a cause notes"),
          );
        } else {
          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("cause");
          if (tabIndex > -1) {
            g_tabs2Sections.setActive(tabIndex); //checks if the findTabIndex() function found the 'cause' tab (i.e., if the index is valid, meaning it is greater than -1).
            g_tabs2Sections.markTabMandatoryByField("cause"); // sets the tab mandatory
          }
        }
        g_form.hideFieldMsg("cause");

        if (g_form.getValue("cause") == "") {
          g_form.showFieldMsg(
            "cause",
            getMessage("Cause notes are required."),
            "error",
            false,
          );
        }
        return false;
      }
    }
  }
}

however its not working.
though, its getting the account value.

what i did is i make a new On Submit client script based on the default one "Validate Resolution Information (Case)"
Also please see screenshot for reference.

 

Robbie
Kilo Patron
Kilo Patron

Hi @Krishna142,

 

Based on the baseline Customer Service Management (CSM) configuration there are 2 areas where these values are set:

- Client Script: 'Validate Resolution Information (Case)'

- UI Policy: 'Show close notes if closed or resolved'

 

Please see the below screenshot of the UI Policy: ' Show close notes if closed or resolved' 

You will either need to update or inactivate both the Client Script and UI Policy accordingly.

 

To help others (or for me to help you more directly), please mark this response correct by clicking on Accept as Solution and/or Helpful.

 

Thanks, Robbie

 

Screenshot 2024-01-24 at 15.11.03.png