- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-07-2020 10:06 AM
There is a need to hide the New button of Change Tasks on Change Request only for STANDARD CHANGES.
In Emergency and Normal change, the New button should be visible.
Could someone help what script I need to write in Omit New condition please?
Solved! Go to Solution.
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-07-2020 10:31 AM
Script like this, use my instructions above around getting to configure > list control:
var answer = false;
if (parent.type == 'standard') {
answer = true;
}
answer;
Please mark reply as Helpful/Correct, if applicable. Thanks!
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-07-2020 10:31 AM
Script like this, use my instructions above around getting to configure > list control:
var answer = false;
if (parent.type == 'standard') {
answer = true;
}
answer;
Please mark reply as Helpful/Correct, if applicable. Thanks!
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-07-2020 11:11 AM
After adding this above script .New button is invisible for Normal and Emergency change also.
And there is one more condition we need New button to be hidden. All change type with state != Closed or Standard changes

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-07-2020 11:31 AM
Hi,
I'm unsure of your scripting knowledge and was hoping to provide a pretty good example for you to then improve upon, which I did above. That gives you good baseline to work from.
Please ensure you logout/log back in and perhaps clear your instance cache by typing: cache.do and pressing enter in left-hand nav.
The code I provide does work as I'm using it in my instance right now:
Standard change:
Normal and other change:
Did you need more assistance than that? You did not state the additional state requirement in your original question. Please ensure you include everything so that we can help accordingly. Otherwise, we work on it work for to help, you add more piece by piece, which isn't very fair to others helping.
So now you're saying:
"And there is one more condition we need New button to be hidden. All change type with state != Closed or Standard changes"
So you want to hide the new button for all change requests that are not closed...so they can only open a change task if the record is closed? That doesn't sound right to me.
Please take time to fully describe what you need assistance with as your original question has been answered by my instructions and script above.
Thank you so much!
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-10-2020 12:38 AM
Hi Allen,
Yes, my original post was an incomplete statement of need. Sorry about that.
After a bit of modification to the script, it is fulfilling the new need.
Hide new button conditions:
1. for all standard changes
Or
2. other changes with state closed or canceled.
Thanks for your support!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-10-2020 07:59 AM
Hi
If my post was the one that helped guide you correctly and helped, please mark that as Correct.
Currently, you have your own post marked as Correct.
Thank you!
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!