How to Auto populate currency symbol's from one Field to another field
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-21-2020 10:58 AM
Hi All,
If user select any of the currency symbol for the field "Budget Amount " then automatically the fields which are marked in blue colour should change the currency symbols
(for eg : If we change Dollar to CHF then automatically the other three fields currency symbol should change to CHF )
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-21-2020 11:20 AM
Hi Suji,
For Budget Amount field have an onchange client script as below.
var val = newValue.split(';');
var symbol = '';
var currency = val[0];
var amount = val[1];
if(currency == 'USD'){
symbol = '$';
}else if (currency == 'CHF'){
symbol ='CHF';
}else if(currency =='GBP'){
symbol ='£';
}else if(currency =='JPY'){
symbol ='Â¥';
}else if(currency =='EUR'){
symbol ='€';
}
g_form.setValue('u_populate_from_currency',symbol+amount);
Please let me know if you have any questions.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-29-2020 07:04 AM
Hi Vignesh,
I have tried with the above script which u suggested. When i modify currency symbol for budget amount, the other field currency changing but after saving the record. The other fields are showing only $ symbol its not changing currency symbol
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-23-2020 12:28 PM
Hi
If your fields are of type 'Price', you can write a BR that run whenever the currency is modified.
The script can use two function calls:
current.<field_name>.getCurrencyCode() <--- this gives you the denomination part like $ and so on
current.<field_name>.getCurrencyValue() <-- this gives you the amount part
once you have this data, you can set your target field value:
current.setDisplayValue('<target_field>',current.<field_name>.getCurrencyCode()+';'+current.<field_name>.getCurrencyValue());
This should do the trick!
Let me know if that worked for you.
Swapnil