Currently selected child record/form; Trigger by scrolling

Tap Forms – Organizer Database App for Mac, iPhone, and iPad Forums Script Talk Currently selected child record/form; Trigger by scrolling

Viewing 7 reply threads
  • Author
    Posts
  • August 11, 2023 at 2:16 PM #49759

    alang
    Participant

    Child records/forms are shown on a form in a table. I would like to have a custom form that displays that child records table and a separate larger text box with particular fields from the currently selected record in the table. This is for readability and editing. There is lots of documentation and discussion about accessing child records; however I do not see how, in a script, you can know which child record in the table is currently highlighted. I am wondering how to do that. And the script would be triggered to display particular fields from the selected child record simply by scrolling through the table. As I understand it, a form level script is triggered when a referenced field is changed. But simply scrolling would not change a field. So, the questions are, how to know what the currently selected child record is and how the script would be triggered by simply scrolling to a new record in the child table. Or perhaps there is a better way to approach this?

    Thank you,
    Alan

    August 11, 2023 at 4:07 PM #49762

    Brendan
    Keymaster

    Hi Alan,

    It’s not possible to trigger a script when Tap Forms scrolls. If you have a script on your child form, it will get triggered when you change a value it references.

    In a script, when your reference record, that’s the current selected record.

    August 11, 2023 at 4:17 PM #49763

    alang
    Participant

    I see.  Particular example is.. Parent form is Authors, Child form is Books (Title, Description).  Parent form Authors has link to form Books.  Idea is on form, Authors to scroll through child records Books and have text box which displays Description field of currently selected child record, Books.  Only at a very high level, any thoughts on how to approach this.  Thank you!

    • This reply was modified 8 months, 3 weeks ago by alang.
    August 11, 2023 at 9:17 PM #49766

    Brendan
    Keymaster

    Ya, that’s not possible to change the value of an object on a layout when you select the different child records. You could though, create a Script field to display on the parent record that contains all of the content from the child form for the selected parent record displayed in a different format if you like.

    August 11, 2023 at 9:57 PM #49770

    alang
    Participant

    Ok, thanks for the ideas and explanations. I’ll give it a try.

    August 12, 2023 at 2:50 PM #49771

    Daniel Leu
    Participant

    I do something similar in my CRM database: I have a contact form and a notes form (child form). In the contact form, I select a child record using a check mark. This triggers a form script that populates the Notes History field in the parent record. Now I can have a quick look at the notes history of one or more records. There’s a disadvantage: since I update the contact form, the modification date is updated as well.

    The attached image might better illustrate how this works.

    Attachments:
    You must be logged in to view attached files.
    August 12, 2023 at 3:49 PM #49773

    alang
    Participant

    Thank you Daniel.  That is very helpful.  I am getting more familiar with the API and your approach triggers (no pun) some great ideas.  Thank you!

    August 12, 2023 at 5:44 PM #49774

    Daniel Leu
    Participant

    :-)

    • This reply was modified 8 months, 3 weeks ago by Daniel Leu.
Viewing 7 reply threads

You must be logged in to reply to this topic.