Can't omit NEW button on Change request related list "Incident caused by change"

GM5
Giga Guru

Hello Community,

 

I'm trying to hide the "New" button on change request's related list "incidents Caused By Change" when Change is closed, I've followed the original documentation but this seems to be not working except if the "Omit New" is check marked, but this will hide the button every time and we only want this when closed.

 

This is what I've done on the List control "Omit new condition" script field

  • answer = parent.active == false;
    
    
    answer = !parent.active;
    
    answer = false; //Even hardcoded didn't hide
var answer;
 if (parent.active == true ) {
 //Do not remove the 'new' button
  answer = false; 
} 
else {
 //Remove the 'new' button
  answer = true;
}
answer;

 

In case you are wondering , yes I already checked if the active field value = false

find_real_file.png

Also did Chache.do  hoping is a cache issue but didn't work either, please help, I don't think modifying the OOTB "New " ui action for related lists (the one with action name = sysverb_new) is the only possible way.

1 ACCEPTED SOLUTION

Allen Andreas
Administrator
Administrator

Hi,

This is because there are additional "New" button for the incident table.

The one related here is the one with the "Comments" field value: Related Lists for Incidents

In the condition field, it's not set to evaluate the condition script due to this: isOmitNewButtonWithoutChecks()

You'd need to change that to: isOmitNewButton(), so that the condition field is actually evaluated.

So this does require an edit to the out of box UI Action. I have verified that it does work when this change is done.

Otherwise, you could attempt to do this with Dom manipulation, which isn't recommended and not best practice. Restricting "create" ACL won't work because all users can create incidents out of box.

Please mark reply as Helpful/Correct, if applicable. Thanks!


Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

View solution in original post

3 REPLIES 3

Allen Andreas
Administrator
Administrator

Hi,

You'd need to use "current" as the current record is the main record on the page.

So something like:

var answer;
answer = !current.active;
answer;

Please mark reply as Helpful/Correct, if applicable. Thanks!

 


Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

Allen Andreas
Administrator
Administrator

Hi,

This is because there are additional "New" button for the incident table.

The one related here is the one with the "Comments" field value: Related Lists for Incidents

In the condition field, it's not set to evaluate the condition script due to this: isOmitNewButtonWithoutChecks()

You'd need to change that to: isOmitNewButton(), so that the condition field is actually evaluated.

So this does require an edit to the out of box UI Action. I have verified that it does work when this change is done.

Otherwise, you could attempt to do this with Dom manipulation, which isn't recommended and not best practice. Restricting "create" ACL won't work because all users can create incidents out of box.

Please mark reply as Helpful/Correct, if applicable. Thanks!


Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

Thank Allan, that did the trick... by the way where did you find that information, before ending here in community I swapped all sn docs and didn't see this, was this part of a Problem workaround or something else? I'd love to share this with my workmates but probabbly they are going to ask where this info is located.

 

Thanks again for helping me with this.