Trace:
Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
visionx:masterdetail_nofk [2020/03/09 11:24] admin |
visionx:masterdetail_nofk [2020/06/10 10:24] (current) cduncan |
||
---|---|---|---|
Line 1: | Line 1: | ||
~~NOTRANS~~ | ~~NOTRANS~~ | ||
- | ~~Title: Use Master/Detail without Foreign Key ~~ | + | ~~Title: Use Master/Detail Without Foreign Key ~~ |
- | Usually, VisionX creates Master/Detail relations with Foreign Keys directly in the database, e.g. | + | Usually, VisionX creates master/detail relations with foreign keys directly in the database, e.g., |
{{:visionx:masterdetail_fk.png?nolink|}} | {{:visionx:masterdetail_fk.png?nolink|}} | ||
- | This is the perfect use-case for a Master/Detail screen like this one: | + | This is the perfect use-case for a master/detail screen like this one: |
{{:visionx:masterdetail_screen.png?nolink|}} | {{:visionx:masterdetail_screen.png?nolink|}} | ||
- | Every Project (1) has a list of tasks (2). This is the perfect scenario. | + | Every project (1) has a list of tasks (2). This is the perfect scenario. |
\\ | \\ | ||
\\ | \\ | ||
Line 17: | Line 17: | ||
{{:visionx:masterdetail_nofk.png?nolink|}} | {{:visionx:masterdetail_nofk.png?nolink|}} | ||
- | The foreign key is missing in the database. But no worries, it's still no problem to create a screen with a Master/Detail relation as shown above. Best would be, to create a new empty screen (1): | + | The foreign key is missing in the database. But no worries, it's still no problem to create a screen with a master/detail relation as shown above. The best way would be to create a new empty screen (1): |
{{:visionx:masterdetail_newempty.png?nolink|}} | {{:visionx:masterdetail_newempty.png?nolink|}} | ||
- | Next, let us include the table objects. Start by creating a new table (2). The new table wizard will appear: | + | Next, let's include the table objects. Start by creating a new table (2). The New Table Wizard will appear: |
{{:visionx:masterdetail_newtable.png?nolink|}} | {{:visionx:masterdetail_newtable.png?nolink|}} | ||
- | Please choose **Use existing data from database tables** (1) | + | Please choose **Use existing data from database tables** (1). |
{{:visionx:masterdetail_newtable_appuser.png?nolink|}} | {{:visionx:masterdetail_newtable_appuser.png?nolink|}} | ||
Line 33: | Line 33: | ||
{{:visionx:masterdetail_projects.png?nolink|}} | {{:visionx:masterdetail_projects.png?nolink|}} | ||
- | In our example the master table is **Projects** (1). Now we need the detail table as well. Repeat last 4 steps and create a new table for the Tasks table. The result should look like: | + | In our example the master table is **Projects** (1). Now we need the detail table as well. Repeat last four steps and create a new table for the Tasks table. The result should look like: |
{{:visionx:masterdetail_tables.png?nolink|}} | {{:visionx:masterdetail_tables.png?nolink|}} | ||
Line 41: | Line 41: | ||
{{:visionx:masterdetail_edit_tasks.png?nolink|}} | {{:visionx:masterdetail_edit_tasks.png?nolink|}} | ||
- | edit the Tasks table (1) and Show more (2) options. Next, enable Database changes (1) and Navigate to the Projects Id column (2). Press Define Combobox (3) | + | edit the Tasks table (1) and show more (2) options. Next, enable database changes (1) and navigate to the Projects Id column (2). Press "Define Combobox" (3), |
{{:visionx:masterdetail_edit_tasks_dbchanges.png?nolink|}} | {{:visionx:masterdetail_edit_tasks_dbchanges.png?nolink|}} | ||
Line 49: | Line 49: | ||
{{:visionx:masterdetail_edit_tasks_projects.png?nolink|}} | {{:visionx:masterdetail_edit_tasks_projects.png?nolink|}} | ||
- | Now we have a relation between Projects (ID) and Tasks (PROJECTS_ID). Be sure that you pressed Finish. No worries, the database won't be changed in this case.\\ | + | Now we have a relation between Projects (ID) and Tasks (PROJECTS_ID). Be sure that you press "Finish". No worries, the database won't be changed in this case.\\ |
\\ | \\ | ||
- | As final step, we have to define the master table reference. Start the edit Tasks table wizard once again and set the Master Table to Projects (1): | + | As final step, we have to define the master table reference. Start the **Edit Tasks Table** Wizard once again and set the master table to Projects (1): |
{{:visionx:masterdetail_tasks_master.png?nolink|}} | {{:visionx:masterdetail_tasks_master.png?nolink|}} | ||
- | The data area for the Tasks table now has a different symbol (1) which means that the Tasks table has a master: | + | The data area for the Tasks table now has a different symbol (1), which means that the Tasks table has a master: |
{{:visionx:masterdetail_tasks_icon.png?nolink|}} | {{:visionx:masterdetail_tasks_icon.png?nolink|}} | ||
- | Now it's possible to use the tables as usual and the Master/Detail will work automatically. | + | Now it's possible to use the tables as usual and the master/detail will work automatically. |