Showing other forms in equations

Viewing 3 reply threads
  • Author
    Posts
  • January 15, 2025 at 12:30 PM #51511

    Jeff Diamond
    Participant

    When I look at the sample Invoice document, if you go to a calculation and click in the formulas area, all 3 forms in the document are visible to select fields from. When I do that in my forms, only fields from the current form show. How do you link the other forms so that are accessible from the equations? Example is the Full Address field from Customers in the Invoice form.

    January 15, 2025 at 11:32 PM #51512

    Brendan
    Keymaster

    You need to add Link To Form fields to your form. Or be the parent form of another form. Or you need to have a Table field in your form. So then all the fields that are related to those linked forms or Table fields are available to perform calculations on.

    See this topic in the manual:

    https://www.tapforms.com/help-mac/5.3/en/topic/relationships

    January 16, 2025 at 10:05 AM #51514

    Jeff Diamond
    Participant

    I added a Link to Form and they now show up. However, I still can’t get the supplier’s full address to populate in the invoice. In looking closer at your invoice sample, I see your link to the Customers Form is a Link From Form. When I click the Show Inverse Relationship box, it never changes from Link To… to Link From… I can see in the Link To Form sheet, that the proper record is being pulled up from the Suppliers form, but it will not populate the Full Address field. I also noticed that if I just click the Suppliers::Full Address, it puts it in a Total() function, which returns a zero. Typing it in manually as it is in your sample, I get nothing. I attached some screenshots because my linked field looks different from yours, presumably because of the To and From issue.

    Attachments:
    You must be logged in to view attached files.
    January 16, 2025 at 8:47 PM #51517

    Brendan
    Keymaster

    Hi Jeff,

    With a Join relationship, both sides of the relationship are “many” relationships. That means both sides, the parent and the child, can have many records.

    In the Invoices form, there can be only one parent for a child record, so the Link From Form field can be used to directly get a parent record’s value to display on the child. With a Join or Many to Many, you need to use a Script field, get the first parent record, then get the values for the fields you’re interested in.

    A Link From Form field is created automatically for you on the child form (the form you’re linking TO) when you enable the “Show Inverse Relationship” option.

    So basically you need a script that fetches the records from the parent, creates the value you want to display, and returns it.

    Thanks,

    Brendan

Viewing 3 reply threads

You must be logged in to reply to this topic.