Client Script to clear currency field value in Service Portal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-13-2023 07:25 AM
I have a currency field where, if the amount exceeds $1000, it should clear the value and displays a field message. My onChange client script (see below) includes the following lines and works fine in the UI, but the field value does not clear in the Service Portal. Any thoughts/ideas?
if(g_form.getValue('cost') > 'USD;1000.00') {
g_form.setValue('cost','NULL');
g_form.showFieldMsg('cost', 'Cost cannot exceed $1000', 'warning');

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-13-2023 07:35 AM
Hi @Nichole L
Can you please try this g_form.clearValue('cost')
Please upvote if you found this helpful
Krishna Sharma
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-13-2023 07:51 AM
I've tried this as well, and it doesn't work in either UI or Portal. I've read other posts where this doesn't work because it's a currency field.