- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-08-2018 05:37 AM
Hi Team,
I have been trying to remove/clear values from a currency field based on a true/false field on a form.
I used client script and even UI policy but it did not worked so far. Below is my client script, I tried even using SetValue but it didn't worked either.
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue == 'false') {
return;
}
if(g_form.getValue('invoice_calc')=='true'){
alert('Hi How are');
g_form.setValue('ia_ser_m',"");
g_form.clearValue('ia_ser_m');
g_form.clearValue('credit_app_invoice'); // Non currency field and clear values works here
alert('clear values');
g_form.setValue('ia_ser_m','');
alert('set values');
g_form.setReadOnly('ia_ser_m',false);
g_form.setValue('ia_ser_m_sp','');
alert('Last');
}
//Type appropriate comment here, and begin script below
}
Thank you for help in advance.
Regards,
Narmi
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-08-2018 11:37 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-08-2018 06:02 AM
I tried this and it works for me.
function onLoad() {
//Type appropriate comment here, and begin script below
g_form.clearValue('name');
g_form.setValue('amount', 0.00);
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-08-2018 11:37 AM
Have you tried this ?
g_form.setValue('amount', 'NULL');

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-08-2018 12:16 PM
Hi Farci,
As you mentioned
g_form.setValue('ia_ser_m',"");
g_form.clearValue('ia_ser_m');
both code will work. Make sure your backend name (ia_ser_m) is correct.
Hope this helps
Regards
Ujjawal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-08-2018 08:15 PM
Hi,
Thank You for all your replies. g_form.setValue('amount', 'NULL'); works for Me.
Regards,
Narmi