How to fetch user name in an field

how can i fetch the username whenever i create a new item
strong text
image
here when i add new item user name should fetch automatically

current/login username, right?

1 Like

yes the user who is adding the item Mr @NCP

Create a custom link field and set it.

example:

1 Like

@NCP

image

its showing user instead of actual name

So you have to apply the client script for that,

You will need to remove the link field and set the data field type, and then apply it.

frm.set_value('user_field_name', frappe.session.user_fullname);
2 Likes

let me provide some more details to better understanding


this is the customer name field for registration

and i want to show this here by default when customer adds an item

You have to write a custom server/client side logic and set it according to the scenario! I have provided what you wanted full username. I have given its syntax.

@NCP Solved :heavy_check_mark: :heavy_check_mark: