- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-05-2020 04:38 PM
I need to compare a currency value field on a client side script. If the currency field value is less than 10,000 than an info message appears. How do I access the integer value of the currency field? The server side equivalent is "getCurrencyValue", I don't what to do client side though. Also, "onChange script error: ReferenceError: u_final_offer is not defined function () { [native code] }" is an errorI'm getting when executing my client script.
Please help.
Solved! Go to Solution.
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-05-2020 06:06 PM
I would suggest you to write UI policy on curreny field rather than writing client script directly.
Condition : currency is between 0 and 10000
Then go to the script tab select "Run Scripts" and the code below
g_form.showFieldMsg('currency','Your message here','error');

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-05-2020 06:06 PM
I would suggest you to write UI policy on curreny field rather than writing client script directly.
Condition : currency is between 0 and 10000
Then go to the script tab select "Run Scripts" and the code below
g_form.showFieldMsg('currency','Your message here','error');
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-06-2020 08:35 AM
I like this solution, it is much simpler....however, I can't make it work on change. Users might click save/update and not see the message...
This instruction is mentioned under the UI policy form: "Apply the UI policy actions when the form is loaded and when the user changes values on the form".
It is not really working "onChange", though..

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-06-2020 10:09 AM
Hi Samuel,
You could add below code, just before the code I provided to clear the value entered by user whenever condition is not being satisfied. Then you could achieve your goal I think.
g_form.clearValue('currency');
g_form.showFieldMsg('currency','Your message here','error');
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-06-2020 08:38 AM
This instruction is mentioned under the UI policy form: "Apply the UI policy actions when the form is loaded and when the user changes values on the form".
It is not really working "onChange", though..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-29-2024 11:26 PM
Please try below code :