Show only comments in Activity below of Task

I have two types of objects in Activity/Communication: comments and notifications.
I’m intrested in customization for Tasks only or for all doctypes (if they are the same). When I choose Communication I want to see only comments (without e-mail notification texts). Is it possible to customize?

Hi @moistcity999:

Use client script for your “Task” doctype.

frappe.ui.form.on('Task', {
	refresh(frm) {
		$('div.timeline-message-box[data-communication-type="Communication"]').hide();
		$(".timeline-badge").hide();
		$('[id^="communication"]').hide();
		$('div.timeline-item[data-doctype="Communication"]').hide();
	},
});

Hope this helps.

1 Like

Thank you, this works! But not always.
When I open Task and active is Activity / Communication that’s OK
I don’t really understand what is dependence (UPD maybe last chosen in previous document is remembered), but in some cases when I open Task Activity / All is active. And there is problem - then I see only comments in All, not as I want in Activity / Communication, and when I switch in Communication there are all comments+notifications.
I think it will be ideal if Activity / Communication was active in all cases of opening Task. Is it possible to customize?