Client script oldValue always empty

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-07-2017 12:12 PM
I am writing an on Change script for the change module. When I try and if (newValue == 'This' && oldValue == 'that') it is not working. So I did a alert(newValue) along with an alert(oldValue) and oldValue is away returning as empty. What might be causing oldValue not to return anything? Just note that newValue is always returning what I expect it to.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-07-2017 12:43 PM
Brian,
You can get previous value in Business Rule. I am not sure if that will be helpful with your requirement and fulfill your use case.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-08-2017 09:07 AM
I don't think that will work as I do not think these is a way to hide options or add options back in a drop down though a BR.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-18-2018 03:08 PM
Same problem, trying to use it on Catalog Client Script. I need to use oldValue to check what the previous option was so I can reset if needed options that I have removed from a drop down select box. Example: If field 1 is x remove two options from field 2, if user changes mind and sets first field to y I need to allow those removed options to appear again in drop down field 2.
Marshall
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-23-2019 12:00 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-24-2019 05:00 AM
Its been so long. I think I converted it to a business rule. I don't work at the company anymore so I don't have a way to look. It appears that client script always returns null for oldValue so I'm not sure why they even have it.