//Replace Your Field with "custom_salary1" //
frappe.ui.form.on('Employee', {
refresh: function(frm) {
// Add a trigger when the form is refreshed or loaded
frm.events.custom_salary1_from_ctc(frm);
},
ctc: function(frm) {
// Add a trigger when the ctc field is changed
frm.events.custom_salary1_from_ctc(frm);
},
custom_salary1_from_ctc: function(frm) {
// Get the value from the ctc field and set it in custom_salary1
var ctc_value = frm.doc.ctc;
frm.set_value('custom_salary1', ctc_value);
}
});
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter