so I have an app and I want to gather information from different doctypes and aggregate all to one form.
I have an issue with functions synchronization:
frappe.db.get_list('First DocType',{
filters:{
'field_one': 'text'
},
fields:['feild_two']
}).then(records => {
frm.set_value(record, records.feild_two);
};
frappe.db.get_list('Second DocType',{
filters:{
'field_three': 'text2'
},
fields:['feild_four']
}).then(records => {
frm.set_value(record_2, records.feild_four);
};
...
etc.
You get the point…
The thing is, I don’t get all I need in one go.
Sometimes I receive everything right, but sometimes I don’t get all the information.
So as I understand it, it’s because of functions not waiting for each other to end.
Is there a way to fix this, without resulting to python scripts with white lists and all of these?
I really hate to start massing with over convoluted JSON responses…