List Control

sunny13
Giga Expert

Hi All,

I'm trying to hide "Edit" in the change task related list by using advance script in list control   for people without change_manager role and also there is an OR condition with respect to state.

Please review my code,

var answer;

if(gs.hasRole == "change_manager" ) ||   (parent.state=='3' || parent.state=='4' || parent.state=='-2' || parent.state=='-13' || parent.state=='-14' || parent.state=='2' || !parent.active;)

{

  answer=false;

}

else{

  answer=true;

}

But what happens is the EDIT button is not visible to anyone with any role except ADMIN i even revoked all changes but the EDIT button is missing from the related list.

But NEW button is visible to Users

find_real_file.png

Can someone help me debug this issue.

1 ACCEPTED SOLUTION

The change_task table should be editable to the user. Make sure the MPI


Change Manager has write access to the table.


View solution in original post

31 REPLIES 31

Hi Santosh,



you were write i just created two ACL's one Create and another write i helped me fix the issue.


david_legrand
Kilo Sage

Hi Sajin,



You should be in very good hands with Santosh and the other guys


But if you really need, and because it's a really long and technical discussion, I would like to take our breath and start from the use case and its context.



Examples:


Only "role" can create change tasks when the change is ...


It's forbidden for people without the role to create any change tasks


As a change manager, when the change is ..., I can...


The "edit" button isn't the ServiceNow edit button but a "new change task" button



And as we'll be aligned on the requirements, it'll be easier to provide advice on what to do


Hi David,



Users Reported that the EDIT button is missing from the Change task Related list in a CR as a part of it i just examined the List control of the change task related list and found that there is Advance script used in the Omit Edit button session.



find_real_file.png



I just cleared the conditions to check whether the EDIT button is visible for users but it did not



Later tried the above suggestions from the community members and still i'm facing this issue.



The Requirement is simple,



Show the EDIT button always in the Ctask related list of a CR for users with role "MPI Change Manager"   also this EDIT button should be visible to the other users when the state of CR is one mentioned above.



Incase nothing works out At the least i would like to show the EDIT button always only to the users with role "MPI Change Manager"



Hope the requirement is clear.



Thanks in Advance.


And you aware that the change tasks have only one parent so by using "edit", you actually move change tasks from Change A to Change B?


==> I'm adding the info because it seems extremely odd logic


==> It would make more sense to create new change tasks for example



But if you are absolutely sure of what you need, you might want to mark the change_request (the link) of the change_task as reference float.


find_real_file.png



In that case, ServiceNow would use the "edit..." button One to Many (reference floats)


find_real_file.png


Thanks David .



It was a Business Requirement hence the change was made , i will take into account your suggestion.