How to remove add me from custom created list field

k_jayanth
Tera Contributor

I have created a list variable called Tech reviewers and i need to remove Add me icon from this i tried the following code but none of them worked.

----------------------------------------------------------------------------------------------------------------------------------------

$('add_me_locked.change_request.u_tech_reviewers').hide();  

$('add_me.change_request.u_tech_reviewers').hide();        

----------------------------------------------------------------------------------------------------------------------------------------

var parent = document.getElementById("add_me.change_request.u_tech_reviewers").parentNode;  

var child = document.getElementById("add_me.change_request.u_tech_reviewers");  

parent.removeChild(child);

-----------------------------------------------------------------------------------------------------------------------------------------

document.getElementById("add_me.change_request.u_tech_reviewers").style.display='none';  

document.getElementById("add_me_locked.change_request.u_tech_reviewers").style.display='none';

-----------------------------------------------------------------------------------------------------------------------------------------

When i apply this for watch list or work notes list it works but not for custom created Tech reviewers field.

Thanks in advance,

- Jayanth

10 REPLIES 10

Goran WitchDoc
ServiceNow Employee
ServiceNow Employee

Hmm.. I'm not a big fan of having these DOM manipulation since they are a pain in the "% ¤@ £ to support when it gets to upgrades etc.



Why is this needed to be removed? If people isn't allowed to put themself in the box, you can solve this by having a before BR to check it and abort if there is and put up a nice message to remove you from the field.


Thanks for the reply Goran,



That is a nice idea, the need for removing the + icon is because tech reviewers are going to be one of the approvers of the change request, hence we don't want the users to add themselves as Tech reviewers. Hence the need for removing the icon.


I think case, I would try to get the responsible for the requirement to understand that we(you) can do this by the before Business rule to make sure it doesn't happen and then just abort the save. By doing it this way you will stop a lot of maintenance later on where you can spend that time to better things.


plaura
Tera Contributor

Little late but you can add the attribute "no_add_me=true" to the dictionary like you do whit no_email or no_multiple (the specific attribute is not documente but I find it...).