Page 1 of 1

Auto Filling a Eployee_id

Posted: Thu Jul 23, 2020 3:32 pm
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?

Re: Auto Filling a Eployee_id

Posted: Thu Jul 23, 2020 3:54 pm
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();
}

Re: Auto Filling a Eployee_id

Posted: Thu Jul 23, 2020 3:58 pm
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 :)