Client script not working in Agent workspace but works in Platform view

Kamy
Tera Contributor

I have a issue where the onChange script that I am using is trying to find a difference between two fields and populates the value in the third field. It is working in the Platform view but is not working on the agent workspace. Below is the onChange script logic that I have that is working fine in the platform view but not in agent workspace.

function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue === '') {
return;
}

var amt = parseInt(g_form.getValue('amt1').substring(4)) - parseInt(g_form.getValue('amt2').substring(4));
g_form.setValue('amt3', 'USD;'+amt);

}

So here we are taking the difference between amt1 and amt2 and setting it to amt3. Not sure why this is not working in agent workspace.

I am getting a negative value of what we enter in amt2 field as a result in amt3 field instead of the different between amt1 and amt2 fields. 

Any inputs would be appreciated. Thank you!

7 REPLIES 7

Anurag Biswas
Tera Contributor

Did you manage to resolve the issue?

 

Prakriti
Tera Contributor

Hi was there any resolution here, we still facing the same issue in our workspace

Abinash2
Tera Contributor

Select UI Type "All" on client script. It worked for me on both Native and Workspace.