The CreatorCon Call for Content is officially open! Get started here.

Client Script to clear currency field value in Service Portal

Nichole L
Tera Contributor

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');

 

 

 

6 REPLIES 6

Community Alums
Not applicable

Hi @Nichole L 

 

Can you please try this g_form.clearValue('cost')

 

Please upvote if you found this helpful

Krishna Sharma

 

 

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.