Hello all, here is my situation.
I want to make a table with services that will have some fields (id, service name etc) then I want to make another table that will pull dynamic the records from the first table and turn them into fields. For example in the table services a user will put 2 records let's say Webhosting and Domain Names, so the second table will have these 2 records for fields (Webhosting and Domain Names) after some time the user will create a new record let's say Support, then I want the second table to have a third field called Support.
Is there any way to make this?
Creating Auto Fields in a Table
Re: Creating Auto Fields in a Table
Hi,
not sure I got exactly what you mean, but if the second table is kind of a single record with all the records from the first table (for one field), then you could have one field to hold an index for the user and a second field that would hold all entries from the first table.
not sure I got exactly what you mean, but if the second table is kind of a single record with all the records from the first table (for one field), then you could have one field to hold an index for the user and a second field that would hold all entries from the first table.
Any help offered comes with the best of intentions. Use it at your own risk. In any case, please make a backup of your existing environment before applying any changes.
Re: Creating Auto Fields in a Table
So you'd like to turn records of one table into columns of a second table like so:
Table "Services"
Data
1 ; Webhosting
2 ; Domain Names
3 ; Support
Table "TABLE2"
That's not possible "on the fly" with standard AppGini, because AppGini requires a static model for generating database tables, serverside- and clientside code and user interface. When working with AppGini, AppGini itself does not know about any records inside any existing database on any remote or local server at all.
You may consider using a SQL command in _after_insert hook of "services" table for creating new columns in TABLE2.
You may consider renaming existing columns in TABLE2 in before_update/after_update hook of "services" table using SQL.
You may consider deleting existing columns in TABLE2 in before_delete hook of "services" table using SQL.
But creating/modifying/deleting columns this will not change any User Interface.
Adding dynamic forms for data entry and listing of data, data-validation and serverside storage after POST will be separate tasks.
That's quite a lot of work.
Table "Services"
Code: Select all
-id
-name
1 ; Webhosting
2 ; Domain Names
3 ; Support
Table "TABLE2"
Code: Select all
-id
-webhosting
-domain_names
-support
You may consider using a SQL command in _after_insert hook of "services" table for creating new columns in TABLE2.
You may consider renaming existing columns in TABLE2 in before_update/after_update hook of "services" table using SQL.
You may consider deleting existing columns in TABLE2 in before_delete hook of "services" table using SQL.
But creating/modifying/deleting columns this will not change any User Interface.
Adding dynamic forms for data entry and listing of data, data-validation and serverside storage after POST will be separate tasks.
That's quite a lot of work.
Kind regards,
<js />
My AppGini Blog:
https://appgini.bizzworxx.de/blog
You can help us helping you:
Please always put code fragments inside
AppGini 24.10 Revision 1579 + all AppGini Helper tools
<js />
My AppGini Blog:
https://appgini.bizzworxx.de/blog
You can help us helping you:
Please always put code fragments inside
[code]...[/code]
blocks for better readabilityAppGini 24.10 Revision 1579 + all AppGini Helper tools
Re: Creating Auto Fields in a Table
Thank you my friend I will look at it