Default value of sub-table to foreign key

If you're a new user of AppGini, feel free to ask general usage questions, or look for answers here.
Post Reply
rineeng
Posts: 3
Joined: 2013-08-17 07:56

Default value of sub-table to foreign key

Post by rineeng » 2013-08-17 09:42

If People is the main table and each person can have many Dogs. They are linked with the PeopleID Primary Key from the People table and the PeopleID in the Dogs table one to many. When in the People table and you want to add a new Dog, is it possible to make the PeopleID in the Dogs table default the PeopleID from the originating People deatil view where we clicked on Dogs? That way the IDs of both tables can be hidden from users but will automatically have the right Dogs linked to the right People?

albuchholz
Posts: 10
Joined: 2013-06-04 21:26

Re: Default value of sub-table to foreign key

Post by albuchholz » 2013-08-24 15:41

1. To have the value of PeopleID assigned and not changeable

in the templates/Dogs_templateDV.html file for the field PeopleID change

%%COMBO(PeopleID)%%
to
%%VALUE(PeopleID)%%

2. To hide all of this, use css to set display:none

http://www.w3schools.com/css/css_display_visibility.asp

This would also be a good enhancement to make a clickable option on the developer side....

Post Reply