Hello,
I need to add default 3 rows in a child table of a document in webform.
Managed to do it in the form web, But how can the same be applied on web form?
The code used to do it in the doctype is show below, Can anyone helpout to do the same in webform
frappe.ui.form.on('Customer Opening', {
onload: function(frm) {
if (!frm.doc.credits || frm.doc.credits.length === 0) {
const default_documents = [
"Company Profile",
"Commercial Trade License copy",
"Chamber of Commerce Certificate copy"
];
default_documents.forEach(function(doc_value) {
let child = frm.add_child('credits');
child.documents = doc_value;
});
frm.refresh_field('credits');
}
}
});