Client script not working in Agent workspace but works in Platform view
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-21-2022 07:09 PM
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!
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-21-2022 07:40 PM
see if this helps
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-21-2022 08:16 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-21-2022 08:29 PM
Hi Kamy,
In your client script uncheck global checkbox & select view name as "agent_workspace" then it will work in agent workspace view.
Regards,
Harshal.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-22-2022 07:55 AM
Hi Harshal,
I tried that. It is not working.