Adding a comment to Item Price DocType

Hi all,

I’m trying to create a custom script to add comment so that, when price is saved the old price will be added to timeline comments.


frappe.ui.form.on("Item Price", {
    refresh: function(frm) {
       frm.comments.insert_comment("Submitted", frm.doc.price_list_rate);

On refresh an exception is raised:

TypeError: undefined is not an object (evaluating 'frm.comments.insert_comment')

Any help appreciated, thx

Try cur_frm?

1 Like

@Ben_Cornwell_Mott …same error

Hi @JoEz,

Try this

frm.timeline.insert_comment(“Comment”, frm.doc.price_list_rate)

Thanks, Rohit

1 Like

@rohit_w …it works thanks!

This wont work in V13