I have assigned a global variable and then frappe call is initialized and the value (after callback) is passed to that global variable but it isn’t been called there. Only if i am using array’s push method then it is working but I want the creation of doctypes (only date).
Here’s the code:
var date_s=[];
frappe.call({
method:"frappe.client.get_list",
args: {
doctype:"doc",
fields: [ 'creation'],
filters: {'name': rec_id_s},
},
callback: function(r) {
var a=r.message;
var date=a[0]['creation'];
date=date.substring(0,10);
date_s.push(date)
}
});
console.log(date_s)
Is there any other way to access the global variable .
Also is there any way to directly get creation of that doctype without frappe call ??