I have create one custom data field and want to fetch user full name
Hi @Rahul7218
Add client script
frappe.ui.form.on('Doctype Name', {
onload(frm) {
frm.set_value("fieldname", frappe.session.user_fullname);
}
})
Thank you @Usama_Naveed
i have one question if i want to fetch specific role assign user full name then how?
In this case
frappe.ui.form.on('Doctype Name', {
onload(frm) {
if(frappe.user.has_role('System Manager')){
frm.set_value("fieldname", frappe.session.user_fullname);
}
}
})
Put any role and it will return true or false
then get the full name and set it
1 Like