Disable of hide work notes/additional comments toggle

Tee_Redd
Tera Contributor

Hi everyone,

We would like to hide or disable this toggle on the Incident form:

Tee_Redd_0-1747794352019.png

  • We know how to set the default user preference so both journal fields are shown but we don't want users switching back to only display one.
  • Tried removing the Activities formatter from the form design but that removes the "Post" button from underneath the fields and removes the activity stream, including the filter capabilities.
  • We have done quite a bit of searching on how to achieve this but have so far come up empty.
  • Found a similar post from almost 10 years ago:https://www.servicenow.com/community/itsm-forum/comments-and-work-notes-toggle/td-p/832695
    But the answer to this one doesn't help us and I'm wondering if things have changed in the last 9 years to allow this.

    Any help or assistance is very much appreciated!
2 ACCEPTED SOLUTIONS

Chaitanya ILCR
Kilo Patron

Hi @Tee_Redd ,

create a global onload client script with isolate script as false to hide it

ChaitanyaILCR_0-1747805571010.png

function onLoad() {
    //Type appropriate comment here, and begin script below
    try {
        var button = document.querySelector('.form-toggle-inputs button');
        if (button) {
            button.style.display = 'none';
        }
    } catch (err) {
        console.log(err)
    }

}

 

 

Please mark my answer as helpful/correct if it resolves your query.

Regards,
Chaitanya

View solution in original post

Ankur Bawiskar
Tera Patron
Tera Patron

@Tee_Redd 

you can use onLoad client script on your table and use DOM manipulation.

Note: DOM Manipulation is not recommended practice

1) Ensure "Isolate Script" field for your client script = False so that DOM runs

2) if this field is not on form then from list make it false

function onLoad() {
    //Type appropriate comment here, and begin script below

    var element = this.document.getElementsByClassName('icon-stream-all-input btn-default btn');
    element[0].style.display = 'none';

}

AnkurBawiskar_0-1747808132155.png

 

Output: Toggle icon is removed

AnkurBawiskar_1-1747808303572.png

 

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

View solution in original post

7 REPLIES 7

Robert H
Mega Sage

Hello @Tee_Redd ,

 

You could create a global UI Script that adds a CSS style to the page and hides the button:

 

RobertH_1-1747805137533.png

 

 

var style = document.createElement('style');
style.innerHTML = 'div#multiple-input-journal-entry button.icon-stream-one-input { display: none !important; }';
document.head.appendChild(style);

 

Result:

 

RobertH_2-1747805202495.png

 

Warning: if ServiceNow makes changes to the HTML structure in future then this solution might no longer work and may need to be adjusted.

 

Regards,

Robert

 

 

Chaitanya ILCR
Kilo Patron

Hi @Tee_Redd ,

create a global onload client script with isolate script as false to hide it

ChaitanyaILCR_0-1747805571010.png

function onLoad() {
    //Type appropriate comment here, and begin script below
    try {
        var button = document.querySelector('.form-toggle-inputs button');
        if (button) {
            button.style.display = 'none';
        }
    } catch (err) {
        console.log(err)
    }

}

 

 

Please mark my answer as helpful/correct if it resolves your query.

Regards,
Chaitanya

Ankur Bawiskar
Tera Patron
Tera Patron

@Tee_Redd 

you can use onLoad client script on your table and use DOM manipulation.

Note: DOM Manipulation is not recommended practice

1) Ensure "Isolate Script" field for your client script = False so that DOM runs

2) if this field is not on form then from list make it false

function onLoad() {
    //Type appropriate comment here, and begin script below

    var element = this.document.getElementsByClassName('icon-stream-all-input btn-default btn');
    element[0].style.display = 'none';

}

AnkurBawiskar_0-1747808132155.png

 

Output: Toggle icon is removed

AnkurBawiskar_1-1747808303572.png

 

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

@Tee_Redd 

Hope you are doing good.

Did my reply answer your question?

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader