Tap Forms – Organizer Database App for Mac, iPhone, and iPad › Forums › Script Talk › More than two linked forms with “m to n” or “1 to n”, even recursive
- This topic has 6 replies, 4 voices, and was last updated 3 years, 7 months ago by Gerhard Hoffmann.
-
AuthorPosts
-
April 1, 2021 at 8:52 AM #43993
Gerhard HoffmannParticipantHello together,
is there a way, to combine more than two linked forms with “m to n” or “1 to n” relation?
The following task: Main form: Company
Goal: Project tracking with an “m to n” link. I would like to create a project tracking, there I need the users-name, for every project the cal-dates, notes, different pick lists and other things. Then I need to show the results in the higher-level Company form. However, I cannot do this with the previous tools from TabForms. Can something like this be realized with a script?Best regards,
GerhardApril 1, 2021 at 11:23 PM #43999
BrendanKeymasterHi Gerhard,
Do you mean you have a 3 level hierarchy and you want to show data from the lowest level to the top level?
Like
Parent -> Child -> Grand Child
and you want to show data fromGrand Child
on theParent
form?You can do that with a script, but the way the data would be displayed would be just in a text format, not in something like a table like regular Link to Forms are displayed.
April 2, 2021 at 5:19 AM #44005
Gerhard HoffmannParticipantHi Brendan,
yes, that is what I need.
Do you have an idea, how that script looks like?April 3, 2021 at 1:05 AM #44011
Sam MoffattParticipantOne way I do something like this is to use a Link to Field JOIN field with a common key between the grandparent record and the child record. You might be able to use a calculation field to project down a key value though for my use case I already had one that I was replicating via scripting.
If all you want is all of the grand children listed in the grandparents record (which is very useful at times) then the JOIN field might be the answer to do it somewhat automatically.
If that isn’t what you had in mind then you’re going to be doing some scripting however you can use the calc field if the JOIN field idea works.
April 3, 2021 at 7:54 AM #44016
T.L. FordParticipantLink to Form fields do not show up in the interface’s available fields for Linked forms, but you can still use them.
Example:
i.e.
Projects (project name) -> Project_Employees (allocated manhours) <- Employees (employee name)Show:
Project, Employee Name, Allocated HoursIn a Projects form script, you can easily get the list of allocated manhours from the linked field. However, you need to also get the linked field for Employees from the Project_Employees table for the Employee name.
Even though it doesn’t show up in the interface’s picklist, you can still use them. You just have to go get the IDs from the Linked form.
See the attached database, which shows this in action as well as how to build a Summary report from partial reports.
Attachments:
You must be logged in to view attached files.April 3, 2021 at 7:56 AM #44018
T.L. FordParticipantThe object model can be used to walk all over the database from anywhere to everywhere using the IDs and a good understanding of the model.
http://www.cattail.nu/tap_forms/tap_forms_scripting_102/index_object_model.htmlApril 6, 2021 at 5:31 AM #44051
Gerhard HoffmannParticipantThanks a lot for your help.
I will try it and hope, it will solve my problem.Best regards,
Gerhard -
AuthorPosts
You must be logged in to reply to this topic.