Print message for new document only

if doc.is_new():
frappe.msgprint(str(‘Data is new’))

//here i am checking current document is new .but its not working .i am doing in erp next server script .

for server script use self.is_new()

1 Like

You can follow the @ejaaz step if you tested in a custom app. If you want to test on the UI side, then your code is proper; we tested it, and it worked properly.

1 Like

It’s working now! I tried this for an hour, but it didn’t work before .

Thank you . You are the best! :blush: :star_struck: