When attach a file it triggers a save event how to stop it

Hello everyone,

When I attach file in my custom doctype, it triggers the save event automatically.
and i created a notification for job interview like when we click on save it sends notifications,
This leads to unwated notification sent, This is creating inconvenience. Please help.
i want to stop auto save after attaching a document.
Using Frappe Version 14

Please check it.

@NCP
can you please elaborate where and how to do that, i saw your link but confused.

this.frm.doc.docstatus == 1 ? this.frm.save("Update") : this.frm.save();

i don’t know much about code.

do i need to add this code somewhere ?

Thank You

To stop the auto-save when attaching an attachment, comment out the specific line in the attach.js file.

so i need to open the attach.js file and modify these lines ?

this.frm.doc.docstatus == 1 ? this.frm.save("Update") : this.frm.save();

Please correct me

Yes … !

and i need to open the attach.js file via terminal or vs studio right ?

can you share the path of attach.js file.

Much appreciated.
Thank YOU

How many times do I have to explain it to you :sweat_smile:

The path is already given in the reference above. Look carefully and apply. I explained the same thing to you twice. :sweat_smile:

1 Like

@NCP brother sorry to bother you i’m on learning phase,

is this the correct command to stop save- // this.frm.doc.docstatus == 1 ? this.frm.save(“Update”) : this.frm.save();

Thank YOU

It’s not a command, it’s a js code. You just have to comment out that line.

// this.frm.doc.docstatus == 1 ? this.frm.save("Update") : this.frm.save();

Then reload Ctrl+Shift+R and check it.

@NCP
oh i need to remove that line you mean right ?

as you wish :roll_eyes:

got it thank you :slight_smile:

@NCP hi,
the js code is working fine in the local development mode, but when i tried the same in the production mode it’s not working.

In production mode, you have to restart the bench or migrate the site.

Also run the bench build --force

okay will try and update you, thank you .

where i can learn about these commands and meanings ? any reference .

Thank you

Please check it.

1 Like

Thanks alot , will check the save issue and update you