nioxr
February 9, 2024, 7:19pm
1
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
Hi @nioxr @niraj_regmi
If you want to see where the code is done. So you can see here
const crm_notes = new erpnext.utils.CRMNotes({
frm: frm,
notes_wrapper: $(frm.fields_dict.notes_html.wrapper),
});
crm_notes.refresh();
},
show_activities(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();
},
});
Thank You!
1 Like
Tried this but it does not help me
This can be done with 2 simple steps:
First define fields in doc same as defined in default doc like “Opportunity”.
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();
}
})