The CreatorCon Call for Content is officially open! Get started here.

How can I hide reference icons next to the caller_id field?

PaulHoogenboom
Tera Contributor

Hi,

On the incident form we have two reference icons next to the caller_id field: "Add new user" and "Change user".

Those icons are not visible on the self service incident form. This is all Eureka

I have upgraded one of the non-production instances to Helsinki, and all of a sudden, those icons are visible on the self service form.

Is there a way to hide those icons only on the self service form?

I have tried a on load client script where I entered the "ess" view name, after unchecking the global checkbox.

In the script section I added this code:

function onLoad() {

    //Type appropriate comment here, and begin script below

    $('add_new_user.incident.caller_id').hide();

    $('change_user.incident.caller_id').hide();

}

The icons still appear on the self service form.

Maybe the UI macro's need to be changed, but I don't know how to do this.

Kind regards,

Paul

1 ACCEPTED SOLUTION

marcguy
ServiceNow Employee
ServiceNow Employee

you may even be able to do this even cleaner by checking the view



<g:evaluate>


    var currentView = RP.getParameterValue('sysparm_view');


</g:evaluate>



then just running if view is not ESS


View solution in original post

11 REPLIES 11

marcguy
ServiceNow Employee
ServiceNow Employee

you may even be able to do this even cleaner by checking the view



<g:evaluate>


    var currentView = RP.getParameterValue('sysparm_view');


</g:evaluate>



then just running if view is not ESS


Hi mguy,



Your answer was very helpful and it pointed me to the right direction.


I have applied your solution in the 'add_new_user' UI macro like this:



<j:set var="jvar_n" value="add_new_user_${jvar_guid}:${ref}"/>



<g2:evaluate var="jvar_show_user_display" jelly="true">


  var currentView = RP.getParameterValue('sysparm_view');


  if (currentView != 'ess') {


              "";


  } else {


            "go";


  }


</g2:evaluate>



<j2:if test="$[empty(jvar_show_user_display)]">


    <a id="${jvar_n}" onclick="tearOff2('${ref}')">


        <img border="0" src="images/icons/contacts_new.gifx" title="${gs.getMessage('Add new user')}" alt="${gs.getMessage('Add new user')}"/>


    </a>


</j2:if>



and this works perfectly.


(Must admit that none of the code is my own, but I have combined several things together and it results in working code.)



Thanks a lot.



Kind regards,


Paul


Great to hear that helps ?


sensiple
Giga Contributor

Hi mguy Employee ,



As i'm new to jelly script, i have doubt.


How your code determines the image to be added next to the field assigned to?



Whether the below code tells the dictionary entry attribute of the field assigned to?


<g2:evaluate var="jvar_show_assign_to_me" jelly="true">



I want to add the clickable image next to the field "contact" in the case form.


sample code is appreciated.



Your help on this would be realy great!!!



Thanks & Regards,


Kumaresan M


marcguy
ServiceNow Employee
ServiceNow Employee

That piece is later on in the code when it checks that var is true:



<j2:if test="$[empty(jvar_show_user_display)]">


    <a id="${jvar_n}" onclick="tearOff2('${ref}')">


        <img border="0" src="images/icons/contacts_new.gifx" title="${gs.getMessage('Add new user')}" alt="${gs.getMessage('Add new user')}"/>


    </a>


</j2:if>