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

Tee_Redd
Tera Contributor

Hi all,

The methods from Chaitanya and Ankur both work for what I was looking for.

Thank you!

@Tee_Redd 

Glad to help.

As per new community feature you can mark multiple responses as correct.

If my response helped please mark it correct as well so that it benefits future readers.

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

@Tee_Redd And this one doesn't?