Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
client event trigger example
// add a trigger on field "custom_field1"
cur_frm.cscript.custom_field1 = function(doc, cdt, cdn) {
// update a new field "custom_field3"
doc.custom_field3 = flt(doc.custom_field1)*flt(doc.custom_field2)/1000;
// refresh in form
refresh_field('custom_field3');
}
// add the same trigger on "custom_field2"
cur_frm.cscript.custom_field2 = cur_frm.cscript.custom_field1;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment