Update/Refresh Linked Forms

Viewing 5 reply threads
  • Author
    Posts
  • March 6, 2019 at 8:48 AM #33926

    Kirk Williams
    Participant

    Apologies in advance if I’m missing something simple & obvious – it certainly wouldn’t be the first time I did so!

    I’m looking for a way to update/refresh fields that link to a parent form when that parent form has been updated since the file was opened.

    For example, I have a “Products” form containing individual items, and several parent forms used to create groupings of items (ex: “Container”, “Bundle”, etc.). Parents are linked to the child form and joined by specific fields (these fields are represented on the child as picklists of the parent items).

    When creating new items in “Products”, I often recognize the need for a new parent. I create the new parent item, either in a separate window or by jumping between the two forms, however when I return to the child, the newly created parent is NOT available in the picklist.

    The only remedy I’ve found is closing & re-opening the file itself. While that’s certainly not a monumental chore, this scenario occurs frequently enough that it has become a nuisance – and I can’t help but suspect that I may be missing a simpler solution.

    Thanks in advance for any suggestions you may be able to offer!

    K

    March 6, 2019 at 12:07 PM #33927

    Brendan
    Keymaster

    Hi Kirk,

    You could try refreshing the records to see if that helps instead of closing and re-opening.

    But are you saying that it’s when you add a record in a different window to the same form that it’s not appearing in the other window’s list of parent records? If so that makes sense because when you display the list of records, they’re stored in an array variable which doesn’t know what goes on to the same form in another instance of the document window. I’ll have to write some code to have one document window notify another document window if any changes were made to it.

    March 6, 2019 at 12:21 PM #33928

    Kirk Williams
    Participant

    Thanks Brendan! Sorry, I’m very new to TF and am likely over-complicating this description. To hopefully clarify, what’s not updating is the picklist on the child form when additions are made to its linked parent form. So the parent has records “A”, “B” & “C” – all of which are available in the child’s linked picklist. When entering a record in the child form, I realize I need a “D” parent, so I go to the parent form (either using a new window or by switching to it) and add it. When I return to the child, “D” does not appear unless the entire TF file is closed & re-opened.

    March 6, 2019 at 7:38 PM #33929

    Brendan
    Keymaster

    Hi Kirk,

    So when you say it’s not updating the Pick List, do you really mean a Pick List? Or do you mean a Link to Form field?

    I tried both adding to a Pick List and it showed up when I saved it. So I was able to select from it in my field immediately.

    I also tried adding a record to my parent form and when I went to the child record and clicked the checkmark button, it did show the new parent record that I just added. All without having to close and re-open the document.

    March 27, 2019 at 8:29 AM #34106

    Kirk Williams
    Participant

    Sorry for the delayed response Brendan!

    The example I’m referring to are (I hope I’m describing accurately) Pick lists. Specifically, pick lists that are populated by an existing form (as opposed to those with manually entered values).

    As just one example, I have a form consisting of individual products. Some of these products are related as part of bundled “sets”, which are listed in a separate form. Due to the nature of this project (inventorying my late grandfather’s model train collection for estate liquidation), I don’t always know of the association between products until after they are added to the database.

    Often, I will add an item to the product form, then when researching the details of that product, discover that it is indeed related to another item or group of items, thus creating a “set”.

    If the set in question already exists in the “Full Sets” form, there is no issue; I simply associate the product to it by way of a combo list field that references the sets pick list (see screenshot). The problem {er, inconvenience} is when a set does NOT already exist in the Full Sets form. In this case, I would obviously navigate to the Full Sets form (either in the same or a new window – that doesn’t seem to matter) and add the new full set record. Once I’ve done that, my expectation would be that I could return to the product form and select the newly added full set record from the pick list in order to associate it. Unfortunately, that doesn’t happen, as the newly created full set record does NOT appear in the pick list until the TF file is closed and then re-opened.

    When this occurs, I have tried refreshing the record list (both products and full sets), as well as using a separate window for each form and closing/re-opening one of them. Neither action results in the pick list being updated to include the newly added full set record. Closing the entire file, then immediately re-opening it results in an updated pick list 100% of the time.

    screenshot

    March 27, 2019 at 1:52 PM #34107

    Brendan
    Keymaster

    Hi Kirk,

    Thanks for the added details. I’ll look into this further based on your description.

    However, at the moment with the latest macOS and Xcode versions, I’m having troubles compiling a third party library I use, so once I get that all resolved, then I’ll be able to dig into this issue. I may need to contact the third-party library developer to see if they can help. Unfortunately it’s the CouchbaseLite database engine I use which isn’t compiling anymore, so it’s a pretty important piece of code.

    Thanks,

    Brendan

Viewing 5 reply threads

You must be logged in to reply to this topic.