how can I add comment to a doc from js? (I need to add comment to a doc on its submission, from js). I tried cur_frm.add_comment, cur_frm.cscript.add_comment, doc.add_comment, this.add_comment and none of them were recognized.
Thanks a lot @saurabh6790
@saurabh6790 how about python?
You can do this by writing a whitelisted function . and write code as in below in server side
d = frappe.get_doc(‘Opportunity’, name)
#to add a new comment
it will add a new comment ‘Test Comment’ in Opportunity and doc.name=name