In servicenow client script, showing unexpected end of JSON function navitve code in the…
- User
In servicenow client script, showing unexpected end of JSON function navitve code in the below script, please check and tell me what is the issue. function onSubmit() try 2 var multiRowariableSet = J50N.parse(e_form.getValue('invoice_s_to_credit') || '[]'); var tot = 0.00; var rebillAmount = parseFloat (s_form.getValue(re_bill amount')); var netImpact = 0.00; if (isNaN(rebillAmount)) r rebil1Amount e.e0; for (vari= 0; i < multiRowariableSet.length; i++) var creditAmount = parseFloat(multiRowariableSet[i].credit_amount) ||0.00; tot += creditAmount; if (multiRowVariableSet.length > 0) f s_form.setValue("total_credit", tot.toFixed(2)); ) else ( g_form.setValue("total_credit", ''); if(tot>0) netImpact tot - rebillAmount if (netImpact !-= 0.00) A gform.setValue("net_impact" else ( g_form.setValue("net_impact" netimpact,tofixed(2));
- Assistant
It looks like your script has several syntax errors, which are causing the issues you're seeing. Let's go through the problems one by one and then I'll provide a corrected version of your script.