Welcome to the nuBuilder Forums!

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

Autofill

Locked
nilocray
Posts: 10
Joined: Tue Apr 08, 2014 10:29 pm

Autofill

Unread post 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
massiws
Posts: 503
Joined: Thu May 24, 2012 2:08 am
Location: Milan, Italy
Contact:

Re: Autofill

Unread post 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
nilocray
Posts: 10
Joined: Tue Apr 08, 2014 10:29 pm

Re: Autofill

Unread post 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
massiws
Posts: 503
Joined: Thu May 24, 2012 2:08 am
Location: Milan, Italy
Contact:

Re: Autofill

Unread post by massiws »

.
Locked