Update currency field by GlideRecord
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-30-2017 03:29 AM
Hi guys,
Can I update currency field into table?
How can I update currency field by fix script using GlideRecord?
I'm using this script but not working it :
var gr = new GlideRecord ('alm_asset');
gr.addQuery('u_number','IN','ASSETNUMBER');
gr.query();
while ( gr.next()){
gr.setValue('salvage_value','EUR;3.00'); // no update field ( value is: EUR 0,00 )
gr.update();
}
Regards,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-30-2017 03:47 AM
Hi,
Please try like below,
it works for me
gr.salvage_value='EUR;3';
Also, if this doesn't work out, please add some logs and check, I think it's not going into while loop at all ASSETNUMBER is in quotes.
var gr = new GlideRecord ('alm_asset');
gr.addQuery('u_number','IN','ASSETNUMBER');
gr.query();
while ( gr.next()){
gr.setValue('salvage_value','EUR;3.00'); // no update field ( value is: EUR 0,00 )
gr.update();
}
Thanks
Gaurav
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-08-2024 03:15 PM
I resolved this issue by using the String() method around the currency value. In my example resourceRate is a variable set earlier in my script. I'm not sure if your issue is the same considering you are already hardcoding a string. My example..