Not able to save business rule

Saroj Patel
Tera Expert

SarojPatel_0-1705298762382.png

Error MessageonSubmit script error: TypeError: Cannot read properties of undefined (reading 'replace'):
function onTemplateFieldSubmit() {
      var allowMultipleCarets = false;
      var CaretValidationError = function(message) {
       this.message = message;
      };
      var validationFunc = function(stringVal) {
       if(stringVal.match(/\^\^/))
        throw new CaretValidationError(getMessage("Your template contains an invalid character sequence: multiple carets"));
      };

      try {
       var cfilter = getFilter(fname, true, allowMultipleCarets ? null : validationFunc);
      } catch (err) {
       if (err instanceof CaretValidationError) {
        g_form.addInfoMessage(err.message);
        return false;
       }
      }

                     cfilter = cfilter.replace(/\^NQ/g, "^");
                     hinput.value = decodeURIComponent(cfilter);
      CustomEvent.fire("sys_mapping:on_cond_submit::" + fname, { value: hinput.value, ref: fname });
                 }


This error I'm getting

10 REPLIES 10

Hello @Anil Lande ,

 

No I was facing this issue on my client instance, but thankfully I got the resolution😉

Aniket Chavan
Tera Sage
Tera Sage

Hi @Saroj Patel ,

Good news – I stumbled upon a fix that resolved the record-saving issue for both myself and some colleagues who were encountering the same problem. It seems like an error message was consistently appearing when saving records, be it in client scripts, business rules, UI policies, or any other record in the instance.

Interestingly, the error didn't occur in Chrome's Incognito mode or when using a different browser like Edge. After a bit of trial and error, I discovered that disabling one of my Chrome extensions did the trick. I've attached an image below, indicating the specific extension I disabled.

Give it a shot and let me know if it works for you too. I'm curious to hear your thoughts on this workaround.

 

AniketChavan_1-1705389074666.png

 

 

Please Mark Correct if this solves your query and also mark 👍Helpful if you find my response worthy based on the impact.

 

Thanks,

Aniket

 

subashravivarma
Tera Contributor

Thank you @Aniket Chavan 

Both of your comments were helpful, It worked on Incognito and disabling the McAfee webadvisor. 
But I got the error when I tried editing the Knowledge Base Category. Been breaking my head since morning. 
Thank god I came to the community. 

P.S I am using a CSA learning Instance. 
If this is going to be there for a while, the training and documentation team should update it.

Hello @subashravivarma ,

 

You're welcome! I'm glad to hear that the suggestions provided by me were helpful in resolving the initial issues with Incognito mode and disabling McAfee WebAdvisor.

Regarding the error you encountered while editing the Knowledge Base Category, it seems like a persisting challenge. I understand how frustrating that can be. Hopefully, they can address on the CSA learning instance issue and update it soon.

If there's anything else you need assistance with, feel free to reach out. We're here to help!

Best regards,

Aniket.

Aniket Chavan
Tera Sage
Tera Sage

Hello @Saroj Patel 

I wanted to check in regarding the response I provided. If my suggestions were beneficial in addressing your query or helped in resolving your issue, would you mind marking it as helpful, accepting the solution, and closing the thread?

Your acknowledgment not only shows appreciation for the assistance but also assists future readers who might come across a similar problem.


Thank you for your consideration!

Best regards,
Aniket.