Routine to save a document

Please can anyone help me write a script to save the document through the custom script feature.

I have tried doc.save(), but it does not seem to work

Thanx

cur_frm.save()

2 Likes

Hi,

Thanx for the input. The save now works. But when I put it along with the rest of my code it throws errors.

the code is as follows

cur_frm.cscript.public= function(doc, dt, dn) {
var timestamp= Date.now();
//cur_frm.set_value(“content”, timestamp);
cur_frm.save();
}

where public is a check box. the code executes when change in public is detected.
the code saves the document while cur_frm.set_value(“content”, timestamp); is commented out.
when cur_frm.set_value(“content”, timestamp); is uncommented, errors occur.

Please can you help with this.

Figured it out.

There was a conflict between the data types int and string that caused the error.

1 Like