Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Q&V: Auto-generate the lookup key_field #2316

Open
urapadmin opened this issue Oct 26, 2023 · 2 comments
Open

Q&V: Auto-generate the lookup key_field #2316

urapadmin opened this issue Oct 26, 2023 · 2 comments
Assignees
Labels
kiosk a kiosk issue (not a filemaker issue)
Milestone

Comments

@urapadmin
Copy link
Collaborator

Currently I have to define a lookup and state the key field:

    to_locus:
      element_type:
        text: "#(unit/term_for_locus)"
        name: "TextField"
        value: "#(locus_relations/uid_locus_2_related)"
        lookup:
          lookup_type: "record"
          record_type: "locus"
          display_value: "arch_context"
          key_field: "uid"

That's redundant because there is also the loopup relation in the DSD:
uid_locus_2_related: [datatype(UUID), "lookup('locus', 'uid')"]

I thought to get the key field into the lookup data from the DSD lookup statement on the client side. But first this would be insane and slow to always lookup and interpret the DSD and second I don't even know when resolving the lookup on the client side which lookup statement in the dsd was responsible. At least not on the client's side. Instead of stating the key_field manually in the PLD, I want to try to make the server auto-generate the key_field entry (if it isn't set manually) when it is creating the record for the lookup data.

@urapadmin urapadmin added the new-issue issue needs to be reviewed and labels and projects need to be added. Remove afterwards. label Oct 26, 2023
@urapadmin urapadmin added the kiosk a kiosk issue (not a filemaker issue) label Oct 26, 2023
@urapadmin urapadmin added this to the Kiosk 1.6 milestone Oct 26, 2023
@urapadmin urapadmin moved this to Todo in query & view Oct 26, 2023
@urapadmin
Copy link
Collaborator Author

There is a complication here that is presumably of mere theoretical nature: It is possible that a table is looked up with different key fields. One table could look up a site by ''lookup(site, id)" and another table could use "lookup(site, uid)" or so. In that case it is not possible in the current structure to come up with the right key for the ui_element.
But since I find this rather theoretical I can live with having the manual way of setting a key as a solution for such an exotic case. In almost all cases it will be the same field in the lookup table that's being used a key.

@urapadmin
Copy link
Collaborator Author

Implemented as planned. The code will issue a warning in Kiosk if either the key_field could not be determined because there are different lookups using different keys or the key_field could not be determined at all but is not stated manually.

@urapadmin urapadmin moved this from Todo to test in query & view Oct 27, 2023
@urapadmin urapadmin removed the new-issue issue needs to be reviewed and labels and projects need to be added. Remove afterwards. label Oct 27, 2023
@urapadmin urapadmin modified the milestones: Kiosk 1.6, kiosk 1.7 May 16, 2024
@urapadmin urapadmin modified the milestones: kiosk 1.7, Kiosk 1.8 Nov 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kiosk a kiosk issue (not a filemaker issue)
Projects
Status: test
Development

No branches or pull requests

1 participant