Adding a field after a db was created
Posted: Fri Aug 20, 2021 8:53 pm
I built my db with several fields and created fast forms (browse and create/edit). All was ok
I tried to create another field (TT7_task_creator) into that dabase and didn't want to recreate one from scratch. The reason ? I want to add on the fly, hidden or not editable, a field with the name of the creator of the task (I'll insert automatically the name of the task creator later)
I edited the properties of the browse and edit forms to reflect this addition. However, even the field seems properly inserted in the forms, When I browse or create a new task, the field is always empty. It appears only if I manage the db itself with phpmyadmin.
*EDIT*
It seems that adding a field directly into the db (phpmyadmin) is not necessary. the datatype was missing on the form (even created with phpmyadmin) and obtain an error (Nudebugresult). I "rebuilt" then the form and had no more errors and I'm able now to add the creator into the db.
just (in)validate the way I did before...
*EDIT II*
I suppose I need to add php code in the Before Save (add mode) to inject the name of the logged user into the TT7_tast_creator and make this field readonly. Like this ?
https://github.com/nuBuilder/nuBuilder- ... ve_user_id
Yep, it works !
Hmmm, it doesn't
When I change the user name and choose somebody else (from my user list), the name is displayed as numbers and not the user name...
When I check the zzzz_user_id, I (the admin) am displayed with a name, the users I created are just plain numbers. Will check on my side again to see why.
No explanations. Just created another user. Name in NuBuilder is text, Id in zzzz_user_id is numerical
I tried to create another field (TT7_task_creator) into that dabase and didn't want to recreate one from scratch. The reason ? I want to add on the fly, hidden or not editable, a field with the name of the creator of the task (I'll insert automatically the name of the task creator later)
I edited the properties of the browse and edit forms to reflect this addition. However, even the field seems properly inserted in the forms, When I browse or create a new task, the field is always empty. It appears only if I manage the db itself with phpmyadmin.
*EDIT*
It seems that adding a field directly into the db (phpmyadmin) is not necessary. the datatype was missing on the form (even created with phpmyadmin) and obtain an error (Nudebugresult). I "rebuilt" then the form and had no more errors and I'm able now to add the creator into the db.
just (in)validate the way I did before...
*EDIT II*
I suppose I need to add php code in the Before Save (add mode) to inject the name of the logged user into the TT7_tast_creator and make this field readonly. Like this ?
https://github.com/nuBuilder/nuBuilder- ... ve_user_id
Yep, it works !

Hmmm, it doesn't

When I change the user name and choose somebody else (from my user list), the name is displayed as numbers and not the user name...
When I check the zzzz_user_id, I (the admin) am displayed with a name, the users I created are just plain numbers. Will check on my side again to see why.
No explanations. Just created another user. Name in NuBuilder is text, Id in zzzz_user_id is numerical