Can I move the email icon in UI16 back to where it was in UI15?

aessling
Mega Expert

In UI15 the email icon in tickets was on the bar at the top of the window. Now I have to click on more More options button and then select Email. Is there any way to move the Email icon back on to the bar?

UI15

email ui15.png

UI16

email ui16.png

1 ACCEPTED SOLUTION

josephcustodio
Mega Contributor
12 REPLIES 12

amity
ServiceNow Employee
ServiceNow Employee

After removing first 2 line, it works for me


josephcustodio
Mega Contributor

Check this out.


UI16: Bring the email client icon back to the header
https://share.servicenow.com/app.do#/detailV2/c55ab020137712404e8cd4a76144b0f0/overview


Richard Sudlow
Tera Contributor

I've found a way to bring back the UI15 Email client functionality to the current UI using a bit of everyone's suggestions from this and related threads.

1. Create a UI Action with the following field values:

  • Name: <leave this blank>
  • Table: Incident (or whichever table you need this for)
  • Action Name: email_client_open
  • Form button: true
  • Client: true
  • Onclick: emailClientOpenPop(‘<your_table_choice>’)
  • Save this UI Action

RichardSudlow_0-1665705417996.png

 

It should look like this on the Incident form:

RichardSudlow_1-1665705417998.png

2. Create a new Client script

  • Name: Email Client Icon – UI Action
  • Table: Incident (or whichever table you need this for)
  • UI Type: All
  • Type: onLoad
  • Isolate script: false
  • Script:

 

function onLoad() {

    //Change the icon of the 'Email' button
    transformButton('email_client_open', 'icon-mail');
}

function transformButton(buttonID, buttonIconName) {
    try {
        //Find the button(s) by ID and change the icon
        $$('button[id=' + buttonID + ']').each(function(elmt) {
            elmt.addClassName(buttonIconName);
            //Change the UI Action button to the mail icon
            elmt.setAttribute("class", "btn btn-icon icon-mail");
        });
    } catch (e) {}
} 

 

   

  • Save this Client Script

It should now look like this on the Incident form:

RichardSudlow_2-1665705417998.png

 

3. Open any incident record and then right click and ‘Inspect’ the page

4. Select and inspect the ‘Mail’ icon UI Action from step 1. (email_client_open)

5. Copy the html for that UI Action and paste it on a notepad or somewhere to retrieve it from. It should look similar to this:

RichardSudlow_3-1665705418003.png

 

 

<button class="btn btn-icon icon-mail" style="white-space: nowrap" type="submit" email_client_open=window.email_client_open;emailClientOpenPop('incident');return false;" id="email_client_open" data-action-name="email_client_open" gsft_id="6a5e1cd12f221110db524ae72799b6e1"></button>

 

6. Make note of the target table name from this portion of the html: emailClientOpenPop('incident');. This will need to be concatenated in a later step.

7. Create another new Client script

  • Name: Email Client – UI 15
  • Table: Incident (or whichever table you need this for)
  • UI Type: All
  • Type: onLoad
  • Isolate script: false
  • Script:

 

function onLoad() {
	
	var emailClientTable = "var email_client_open=window.email_client_open;emailClientOpenPop('<your_table_name_here>');return false;";

    $("header_add_attachment").insert({
        before: '<button class="btn btn-icon icon-mail" style="white-space: nowrap" type="submit" value="7c75c4111ba2551068984159cc4bcbb2" onclick="'+emailClientTable+'" id="email_client_open" data-action-name="email_client_open" gsft_id="7c75c4111ba2551068984159cc4bcbb2"></button>'
    });


}

 

RichardSudlow_0-1665711529358.png

 

 

The Incident form header should now have two Email client icons.

RichardSudlow_5-1665705418012.png

 

 

8. Deactivate the UI Action from step 1 and the Client Script from step 2 since they are no longer needed.

9. You Should now be left with the form header looking like this:

RichardSudlow_6-1665705418012.png