Script error encountered when changing this field - please contact your System Administrator - Error Issue

Sriraj V
Tera Contributor

Hi All,

I have :

1) Display BR : Used to check whether current logged in user is a member of particular group or not. And it stores the value in scratchpad and send it to the client side.

2) OnChange CS : Based upon the scratch pad value, if it is true it allow the user to set priority as 1. If it is false, it will restrict the user to set priority value as 1 and displays an error message under the priority field.

At first time it is displaying the error message correctly. But again if i try to test the functionality I am getting this error

"Script error encountered when changing this field - please contact your System Administrator"

What could be the reason, how we can debug this..? Is it because of display BR?

Regards,

Sriraj

 

1 ACCEPTED SOLUTION

I think it would be preferable to add a condition on the script to check oldvalue and newvalue, since as soon as you change impact using setValue() this onCHange script will again run.

You can validate by adding, if(oldValue != newValue)

Best Regards
Aman Kumar

View solution in original post

6 REPLIES 6

Message will remain since we are not explicitly removing it, for achieving this you can keep "g_form.clearMessages();" statement at the beginning of your code, ie before your if condition here your checking for impact and  urgency.

 

It will remove old messages that might be present on the form.

Best Regards
Aman Kumar

Hi Aman, by doing this i am facing an another issue.

Consider impact is 1, urgency is 3 and priority is 3.

Scenario 1 : I am setting urgency as 1 i.e (impact 1 + urgency 1 = priority 1) based upon the on change client script written on the urgency field it wl restrict user to set priority as 1 and resets the urgency to 3 (WHICH IS TOTALLY FINE)

Scenario 2 : Without re-loading the form i changed impact as 2, urgency as 1 and again impact as 1 now user is able to set the priority as 1. Cos it validates our condition if(oldValue != newValue). In our case oldvalue is 2 and new value is 1. Then it wil enter the loop and sets P1. (Issue is here)

Hope i didnt confuse you much abt scenario 2.

Regards,

Sriraj