- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-16-2016 07:59 AM
Hello,
Easy points!! I cannot figure out what is wrong with this client script! I'm trying to allow the "Submitted" option on the state field for a Change Request if the Type field Standard or Emergency.
Originally, the script checked for risk = '' && changeType != 'Standard' " which worked fine.
All I did was add " || changeType != 'Emergency' " in the script, and now it removes the Submitted option. I don't want it to be removed! I have tried every combination I can think of for the parenthesis, splitting out the "if" conditions, and so forth. What am I missing?
Thank you in advance,
Laurie
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-16-2016 08:13 AM
Please try
if (risk == '' && !(changeType == 'Standard' || changeType == 'Emergency')){
Hope this helps.
Please feel free to connect, follow, mark helpful / answer, like, endorse.
John Chun, PhD PMP ![]() | ![]() |
Winner of November 2016 Members' Choice Award
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-16-2016 08:13 AM
Please try
if (risk == '' && !(changeType == 'Standard' || changeType == 'Emergency')){
Hope this helps.
Please feel free to connect, follow, mark helpful / answer, like, endorse.
John Chun, PhD PMP ![]() | ![]() |
Winner of November 2016 Members' Choice Award
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-16-2016 09:11 AM
Just to add to it, Boolean logic-wise, these two are equivalent
R && !(S || E) == R && !S && !E
so you can use whichever you like. As for me, the first one is a bit easer on my brain when there are multiple OR conditions.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-16-2016 08:14 AM
changeType != 'Standard'|| changeType != 'Emergency'
this condition will always return true.
I think your condition should be
risk == '' && changeType != 'Standard' && changeType != 'Emergency'
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-16-2016 08:48 AM
Hi,
if (risk == '' && (changeType != 'Standard' && changeType != 'Emergency'))