I have a script running on a doctype, that pulls data from a child table, and uses it to populate a select field in a second, separate child table.
In practice, this script appears to fail to run the first time an entry from the doctype is accessed, though it does not seem to raise any errors. However, when a second entry from the doctype is accessed, the script then populates the target select field with data from the previously accessed entry.
Here is a video of this occurring: 2024-07-10_11-07-50.mp4
Here is the client script that I am using:
frappe.ui.form.on("jobnum", {
onload_post_render(frm){
frm.set_df_property("po","options",frm.doc.phase.map((row) => row.data_rcui),"jobnum","phase");
}
});
These are the versions that I am using:
ERPNext: v15.27.0 (version-15)
Frappe Framework: v15.29.1 (version-15)
Frappe HR: v15.22.0 (version-15)
As a side note, the script seems to work fine on my account, but malfunctions as described above on any other accounts I create, regardless of what permissions are set.
Did I mess something up in the client script? Is this a bug in Frappe or ERPNext, and if so, how can I work around it? Any help at all would be appreciated.