Hi! I have 2 doctypes, A and B. I’ve created a Custom Script so that every time a document is created in Doctype A, some information is inserted in Doctype B.
e.g.: Doctype A has the field name so the name is transferred to the field name in Doctype B.
frappe.ui.form.on("GC1", {
after_save: function(frm) {
frappe.call({
method: "frappe.client.insert",
args: {
doc: {
"doctype": "GC2",
"nombra": frm.doc.nombre
}
}
});
}
});
To this point everything works fine. The problem appears when I create a web form based on Doctype A (called ‘GC1’). I complete the field for name, the document is created and I can see it on the list of GC1 documents but the creation on Doctype B (called ‘GC2’) isn’t happening anymore. I’m not quite sure about the direction of the workflow from this point. I’ll appreciate any help, thanks!