How do I add activities inside a tab

Activities are HTML Field inside Lead form. I don’t see any way to edit them. Are they somehow hooked with code? If yes, where?

Also how can I use them inside other forms? For example, I want to use the Activites and Note tabs (Currenlty there inside Leads) in the customer forms.

1 Like

any solution on this

Hi @nioxr @niraj_regmi

If you want to see where the code is done. So you can see here

Thank You!

1 Like

Tried this but it does not help me

This can be done with 2 simple steps:

  1. First define fields in doc same as defined in default doc like “Opportunity”.

  2. Then add client script for the doc you want to add activity tab as below:

frappe.ui.form.on(‘Test’, {
refresh(frm) {
const crm_activities = new erpnext.utils.CRMActivities({
frm: frm,
open_activities_wrapper: $(frm.fields_dict.open_activities_html.wrapper),
all_activities_wrapper: $(frm.fields_dict.all_activities_html.wrapper),
form_wrapper: $(frm.wrapper),
});
crm_activities.refresh();
}
})