How to save a Doc from Client Script?

Hello,

I am showing a modal dialog to get input from user.

Based on that input I am updating some data in the Doc.

After updating data I want to trigger Save.

I tried this code

frm.save_doc();

But it is not working.

How to save a Doc from Client Script?

TIA

Yogi Yang

hello, you can use frm.save_or_update() check console for more tips

1 Like

Hello @PyJumper,

Thanks for the hint. It works!

But after I update values in a Child Table when I call this frm.save_or_update() it shows message

No changes in document

How to force ERPNext to recognize changes done to Child Table and save the changes?

TIA

Yogi Yang

you can call frm.dirty() first to force saving

2 Likes