Autoexpand "Show email details" in email log

e_wilber
Tera Guru

Is there a new way we can auto-expand the Show Email Details section inside the activity log so the agents don't have to click it?

find_real_file.png

There are a few old posts from 4-7 years ago with the same question where the solution was adding ($$("img[onclick*='ActivityFilter.activityEmailToggle']")).each(function(item){item.click()}); to a client script. I don't know if anything has changed since then but this is not working for us.

4 REPLIES 4

Musab Rasheed
Tera Sage

Hello,

You may have to do with DOM manipulation which is not recommended by Servicenow hence nothing can be done here.

Please hit like and mark my response as correct if that helps

Regards

Please hit like and mark my response as correct if that helps
Regards,
Musab

Aishwarya Thaku
Tera Expert

Hi @e.wilber ,

 

Try using the below code in the onLoad script-

($$("a[onclick*='ActivityFilter.activityEmailToggle']")).each(function(item){item.click();});

 

Please mark my answer as correct or helpful, if applicable.

Thanks,

Aishwarya

Musab Rasheed
Tera Sage

Hello,

If you are fine with my response, Please hit like and mark my response as correct if that helps.

Regards

Please hit like and mark my response as correct if that helps
Regards,
Musab

Community Alums
Not applicable

The Activity Stream loads after onLoad scripts so you need to watch for when it's loaded before clicking:

angular.element('.sn-form-stream-inline').scope().$watch('loaded', function() {
  jQuery('a[action-type="show-email"]').click();
});