Hi All,
I need autoselect user when creating new expense claim transaction or for any transactions
Thanks in Advance
Hi All,
I need autoselect user when creating new expense claim transaction or for any transactions
Is the expense claim god? How does it know which users to select? ![]()
for example shalini devi end user in her login create expense claim it should autoselect the shalini devi employee field
possible, but if user_id linked with the employee. you can do it using the client script, it’s so simple!
you can make a user employee and then give the employee self-service role
Hi @Syed_Anas,
Even then it will not work, check it.
can u please give me a client script for this i new to erpnext and coding so please
I think you have to understand a few concepts of client script, otherwise, you won’t know anything. So learn a little yourself, and teach people ![]()
Please check the @Jeel reference and learn:
How it work?
frappe.ui.form.on('Expense Claim', {
refresh: function(frm) {
if (!frm.doc.employee) {
frappe.db.get_value("Employee", {"user_id": frappe.session.user}, "name", function(value) {
if (value.name) {
frm.set_value('employee', value.name);
}
});
}
}
});