- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā04-16-2019 01:03 AM
Hi,
I am trying to set currency value to 1 with g_form.setValue("field", "1");
When this client script runs it puts the value 1,00 to the field and after I save the record the value changes to 100.00
I have also tried with GlideAjax but same result. Any ideas?
Thanks
.: Ilkka
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā04-16-2019 05:03 AM
I found the reason for this behaviour and tried it within my own dev instance. It is because this instance has glide.system.locale value of en.FI and it is actually not supported. the locale should be fi.FI
here is the docs site about system locale
and here is the list of supported locale values
http://www.oracle.com/technetwork/java/javase/javase7locales-334809.html
Kind of bad situation because the customer I am working on has the same value in production instance as well, and now I am not sure if it is wise to change it. The docs point out that it should not be changed after the instance is in production.
.: Ilkka
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā04-16-2019 04:48 AM
The currency field only have 1 decimal deparator and thats . (dot)when you set the value in the field
So you just need to make sure that IF your getValue() or variable contains , (comma) as separator then you need to convert it to . (dot) before you set the value again.
Thats what my script does in that community post
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā04-16-2019 05:03 AM
I found the reason for this behaviour and tried it within my own dev instance. It is because this instance has glide.system.locale value of en.FI and it is actually not supported. the locale should be fi.FI
here is the docs site about system locale
and here is the list of supported locale values
http://www.oracle.com/technetwork/java/javase/javase7locales-334809.html
Kind of bad situation because the customer I am working on has the same value in production instance as well, and now I am not sure if it is wise to change it. The docs point out that it should not be changed after the instance is in production.
.: Ilkka
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā01-17-2020 09:02 AM
Currency field will store the data in following format
Currency;amount -> example: USD;1 ->if you specify 1$
try alerting the value alert(g_form.getValue(currency_field)); and set the same value to currency field