0

How do I show data from a child table in a Modal Window?

I have an application where each customer might have multiple addresses and phone numbers which are stored in child tables. When I show the customer in a record on a screen I can place a Modal Window button on the screen which can be pushed at runtime to display detail information for the particular customer parent table which works great. However, I would also like to display the data from the address and phone number child tables. Is there a way to do that? Or can I just launch a hole separate screen which would automatically display the needed data for the particular customer? If yes, how?

Thank you for any help.

Mark
  • 520
  • 1
  • 6
  • 18

1 Answers1

0

If you have the relationships correctly set up, the Customer query in the left hand panel should have links named something like "Add Addresses" and "Add Phone Numbers". If you click one of those, a child table query linked to the table you selected will be automatically set up. Depending on the relationship, you can then display field or grid values from the child tables on the main screen or in modal windows, or use the values in code behind.

As far as I know, this is functionally identical to ticking the checkboxes for additional data on the Add New Screen wizard for templates such as List And Details or New Data.

Edit based on comment info: Two levels of nesting is definitely supported - I've just done it to prove it to myself. I set up Consumer - Contact - Address tables as you described with one to many relationships. Then I created a list and details screen with Consumer and Contact - you can only select one level of nesting deep when creating a screen. Once in the screen, the Contact collection has an Add ConsumerContactAddress link which I clicked. Then add a modal window and drag the Address grid onto it, add a button to the row of the Contact grid and get that to open the window.

It all works perfectly, but even if it didn't you should be able to wire it together yourself by adding a query on the child table with a parameter and then linking that parameter to the appropriate Selected Item value on the parent table. I can't see any reason you couldn't parent-child yourself so many levels deep that your code would be resting on the back of the Great A'Tuin. :)

Phil
  • 261
  • 2
  • 7
  • Phil, You are right. The problem was that it cannot be done if there are nested child tables. I had the Consumer table as the parent, the ConsumerContact as the child to the Consumer table and the ComsumerContactAddress as the child table to the ConsumerContact table. A modal window on a record in the ConsumerContact tab of the Consumer screen would just not show the ConsumerContactAddresses. I ended by backing up and making multiple address and phone fields in the ConsumerContact table. Thankyou for your help. – Mark Mar 13 '15 at 14:24