Auto-expand mails on activity
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-09-2024 01:55 PM
The Washington version is the one we currently use in the instance and we would like to be able to show the "expanded" emails all the time, without the need to click on the "show email details", has anyone implemented something similar?
I have seen some posts in the community but they are a bit old and the proposed solution does not work, any help is really appreciated.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-09-2024 07:12 PM
Hi @Pablo Sanz ,
The above requirement involves using JavaScript to manipulate the DOM of the email record interface over the form, which is not recommended by servicenow and also it doesnt fall under ServiceNow best practices.
Even though if you want to implement please try the below code by creating a onload client script:
First, you need to identify the specific UI element or button that toggles the "show email details."
function onLoad() {
// Use setTimeout to delay the execution slightly to ensure the DOM is fully loaded
setTimeout(function() {
var showDetailsButton = document.querySelector('selector'); // Replace 'selector' with the actual selector for the "Show Email Details" button
if (showDetailsButton) {
showDetailsButton.click(); // Simulate a click to expand the details
}
}, 500); // Adjust delay time as necessary
}
If my response has resolved your query, please consider giving it a thumbs up and marking it as the correct answer!
Thanks & Regards,
Sanjay Kumar