Good Day! I was trying to fetch the owner of the document and the one who submitted it. I was able to fetch it however it only fetch the email instead of the full name.
I also tried var owner = frappe.get_fullname(doc.owner) but it doesn’t work. Hope you could help me for I’ve been searching for days and find no solution to this.
Here’s the custom script:
frappe.ui.form.on(“Material Request”, “validate”, function(frm) {
if (frm.doc.workflow_state == “Pending Request”)
{
frm.set_value(“prepared_by”, frm.doc.owner);
}else if (frm.doc.workflow_state == “Pending Approval”)
{
frm.set_value(“noted_by”, frm.doc.modified_by);
}else if (frm.doc.workflow_state == “Approved”)
{
frm.set_value(“approved_by”, frm.doc.modified_by);
}
});