I would like to create currency field
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-11-2022 10:08 PM
Hello,
I would like to set this field to be currency format automatically.
It means if I enter '10000', it will auto convert to 10,000.00. If I enter '1000000', it will auto convert to '1,000,000.00'. This field will not allow user to manually type comma , and it could support 2 decimal.
The value cannot be exceed than 999,999,999.99.
Could anyone help?
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-11-2022 11:18 PM
Hi,
if this is for catalog item you can use variable validation regular expression for this and link to that variable
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-11-2022 11:27 PM
Yes, it's record producer. Could you please advise the regular expression to fit this requirement?
- The value cannot be exceed than 999,999,999.99
- Auto adding decimal on the currency
- Auto adding comma on the currency
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-11-2022 11:33 PM
Hi,
you can validate point 1 using regex
but for other 2 points you would require onChange client script to set the value
Remember you are writing onChange on same variable and setting same variable value so ensure it doesn't go in loop
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-03-2022 10:15 PM
Hope you are doing good.
Did my reply answer your question?
If my response helped please close the thread by marking appropriate response as correct so that it benefits future readers.
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-06-2022 08:01 AM
Hope you are doing good.
Did my reply answer your question?
If my response helped please close the thread by marking appropriate response as correct so that it benefits future readers.
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader