- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-07-2024 06:05 AM - edited 08-07-2024 06:13 AM
Hi All,
I have requirement to allow the past dates to be set on the fields -"Planned Implementation Start/End Date". The same is working for the Emergency Change type and the client wants the same functionality for the "Latent Change" type.
I tried making the changes on the existing client script which is for Emergency Change but it is not working. I tried adding the line - "g_form.getValue("type") != 'latent_change' with the OR condition on the line number 18( Please refer the screenshot).
Like this : - if (g_form.getValue('type') != 'emergencychangenew') || (g_form.getValue('type') != 'latent_change')
but when i am replacing the type as latent_change in the place of 'emergencychangenew' on line number 18 then it is working for Latent change and not for Emergency change.
Can anyone plz tell what is the mistake I am doing.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-07-2024 06:17 AM
I don't know what is going on, but it seems to be raining OR questions lately. Your query will always return true, like any query with 'OR' and two negatives:
if type is not 'a' OR type is not 'b':
- if type is 'a': true, because it's not 'b'
- if type is 'b': true, because it's not 'a'
- if type is 'c': true, because it's not 'a' (or 'b')
Change it to && instead of || and if that doesn't solve it, please share your entire script, so we can ensure nothing else is wrong in there.
Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-07-2024 06:17 AM
I don't know what is going on, but it seems to be raining OR questions lately. Your query will always return true, like any query with 'OR' and two negatives:
if type is not 'a' OR type is not 'b':
- if type is 'a': true, because it's not 'b'
- if type is 'b': true, because it's not 'a'
- if type is 'c': true, because it's not 'a' (or 'b')
Change it to && instead of || and if that doesn't solve it, please share your entire script, so we can ensure nothing else is wrong in there.
Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-07-2024 06:32 AM
@Mark Manders Thanks Mark.. It worked.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-07-2024 06:18 AM
Hi @Rooma1 ,
It need a overall bracket after if. Try the below code,
if ((g_form.getValue('type') != 'emergencychangenew') || (g_form.getValue('type') != 'latent_change'))
Thanks
Please mark answer correct/helpful based on impact
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-07-2024 06:30 AM
@Deborah Brown L I had already tried this but it didn't work.