Page 1 of 1

Autofill

Posted: Wed Apr 09, 2014 10:49 pm
by nilocray
hi all i was wondering if it is possable to get the system to autofill 2 fields when saving a new record (1:current date 2:current user)

Thanks in advance

Colin

Re: Autofill

Posted: Thu Apr 10, 2014 1:19 am
by massiws
nilocray,
you can use SQL in All tab -> Default Value to autofill your field when opening a new record:

Code: Select all

SELECT CURDATE()            -> to get current date
SELECT '#nu_user_name#'     -> to get current user name
Have a look here for a complete list of hash variables.

To fill fields on save, you have to use nuOnSave() function to perform validation.

Max

Re: Autofill

Posted: Thu Apr 10, 2014 3:59 pm
by nilocray
hi thanks that worked great, made the fields read only so the user cant change then and thay only get filled on new records and not if you reopen the record. no need for the onsave code.

regards

colin

Re: Autofill

Posted: Fri Apr 11, 2014 3:56 pm
by massiws
.