How to convert currency?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-11-2017 02:06 AM
Can anyone help me to convert currency? We have editable currency fields called "Annual Maintenance Cost" and "Annual Maintenance Cost (Ref). When a user update the "Annual Maintenance Cost" with their currency, I'd like to know the amount in JPY. I configured one business rule below. However, it seems not working. I expected "JPY; 110,000,000" for "USD; 1,000,000" but the return value was "JPY; 9,090.9091" as shown in the attachment.
# Business Rule
- Timing
Before Update or Insert
- Code
(function executeRule(current, previous /*null when async*/) {
var value = parseFloat(current.u_maintenance.getReferenceValue());
current.u_is_related = current.u_is_related.getReferenceCurrencyCode() + ';' + value;
})(current, previous);
- Labels:
-
Project Portfolio Management

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-28-2022 02:48 AM
DevTools is a scoped application with many helpful scripts ready to be re-used.
The built-in currency conversion API object (GlideCurrencyConverter) is a bit tricky to use.
Here you can find a nice wrapper function for currency conversion based on the ServiceNow OOTB functionality:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-02-2022 04:14 AM
Please share the correct answer if you have received