logo

NJP

How to set value to an FX Currency field in ServiceNow?

Import · Apr 13, 2021 · article

To set value to an FX Currency field from server-side(like script include, workflow, etc.), use the below sample code:

gr.salary.setDisplayValue('EUR;1000');
gr.update();

To set value to an FX Currency field from client-side(like client script), use the below sample code:

g_form.setValue('salary' , 'USD;1000');

gr is the GlideRecord object to your record that you want to update

salary is the sample field name in back-end,

EUR is the sample currency(Euros)

1000 is the sample amount

Note : In place of EUR, you can use USD / JPY / CHF / GBP

Long Live ServiceNow!

View original source

https://www.servicenow.com/community/now-platform-articles/how-to-set-value-to-an-fx-currency-field-in-servicenow/ta-p/2308307