Welcome to the nuBuilder Forums!

Register and log in to access exclusive forums and content available only to registered users.

Auto Filling a Eployee_id

Questions related to using nuBuilder Forte.
Post Reply
MLeggy
Posts: 7
Joined: Mon Jul 13, 2020 4:23 pm

Auto Filling a Eployee_id

Unread post by MLeggy »

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?
kev1n
nuBuilder Team
Posts: 4307
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 448 times
Contact:

Re: Auto Filling a Eployee_id

Unread post by kev1n »

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();
}
MLeggy
Posts: 7
Joined: Mon Jul 13, 2020 4:23 pm

Re: Auto Filling a Eployee_id

Unread post by MLeggy »

Thanks kev1n,

Worked perfectly, once I had changed the Employee_id to the incorrectly entered Employe_id that i created in my DB :)
Post Reply