Skip to content

Commit 1c8a590

Browse files
Set price field to accept a single currency
1 parent ce199be commit 1c8a590

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
2+
# Client Script - Set Price type field to only one currency
3+
4+
In a multi currecny enabled servicenow environment, if you have a requirement to enable only one currency choice for a particular table and field of type Price.
5+
6+
## Usage
7+
8+
- Create a new client script
9+
- Set the type to OnLoad.
10+
- Copy the script to your client script.
11+
- Update the <price_field> in the client script to 'Your field name'
12+
- Add your currency code and symbol in place of USD & $
13+
- Save
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
function onLoad(){
2+
// Remove all currency options
3+
g_form.clearOptions('<price_field>.currency_type');
4+
5+
// Add only one currency option (e.g., USD)
6+
g_form.addOption('<price_field>.currency_type', 'USD', '$');
7+
8+
// Set the currency field to the only available option
9+
g_form.setValue('<price_field>.currency_type', 'USD');
10+
}

0 commit comments

Comments
 (0)