Afternoon,
My little Timesheet application has an employee field in the main table.
I have a form that does a lookup of all the fields bar 2. and works brilliantly.
The first field is Employee_id. is there a way of auto populating the field with the zzzsysy_user_id field of the current logged on user?
Welcome to the nuBuilder Forums!
Join our community by registering and logging in.
As a member, you'll get access to exclusive forums, resources, and content available only to registered users.
Join our community by registering and logging in.
As a member, you'll get access to exclusive forums, resources, and content available only to registered users.
Auto Filling a Eployee_id
-
- nuBuilder Team
- Posts: 4568
- Joined: Sun Oct 14, 2018 6:43 pm
- Has thanked: 76 times
- Been thanked: 532 times
- Contact:
Re: Auto Filling a Eployee_id
To populate Employee_id with the currently logged in user id, add this JavaScript code to your form's custom code:
Code: Select all
if (nuFormType() == 'edit') {
$('#Employee_id').val(nuCurrentProperties().user_id).change();
}
-
- Posts: 7
- Joined: Mon Jul 13, 2020 4:23 pm
Re: Auto Filling a Eployee_id
Thanks kev1n,
Worked perfectly, once I had changed the Employee_id to the incorrectly entered Employe_id that i created in my DB
Worked perfectly, once I had changed the Employee_id to the incorrectly entered Employe_id that i created in my DB
