Get currency from glide record

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-29-2023 03:41 AM
Hi All.
From an onLoad client script in a table I need to get the currency symbol from another table.
This is the script:
function onLoad() {
var parentCurrency;
var parentDemand = g_form.getValue("task");
var grDemand = new GlideRecord("dmn_demand");
grDemand.get(parentDemand);
parentCurrency = grDemand.capital_outlay.getCurrencyCode();
alert(parentCurrency);
}
The problem is that grDemand.capital_outlay, that is an FXCurrency field, only returns the amount and not the whole currency.
Any help?
Thanks
1 REPLY 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-29-2023 08:03 AM
never, really never perform GlideRecord operations in a client-side script!!!
Instead, perform the code in a display Business Rule, store the result in the g_scratchpad object and access the value via g_scratchpad in your client-script.
Maik