Page 1 of 1

Which file needs the relationships?

PostPosted: Thu Sep 02, 2010 2:54 pm
by jimrecht
Hi John:
I've added two tables to my data file: Rxs and ContactRxs. I've done that because I want to track which medications (Rx's) a patient is taking at any given time.

I relate Rxs to ContactRxs as follows:
Rxs::id = ContactRxs::Rx_id
And I related Contact Rxs to Contacts as follows:
ContactRxs::Contact_id = Contacts::id

Now, to display a portal showing current medications on the Contacts layout, I add these two 2 TO's, with the above-described relationships, to the Complete (interface) file's graph.

My question is this: does my SeedCode Data (data) file also need to contain those two TO's with the same relationships?

Yours,
Jim

PostPosted: Thu Sep 02, 2010 4:41 pm
by John Sindelar
Good question. Often, no. The data file only needs table occurrences tied together if you have lookups, calcs, or auto enters that need these relationships. If you are just showing portal data, or working the relationships using scripting, that all happens in the interface file.

Further, if your totals use SummaryField instead of Sum() calcs, you can often dispense with managing a graph in the data file as well.

We often leave a basic graph in the data file in case someone wants to create a lookup, etc. down the road, but your portals won't be using them.

PostPosted: Thu Sep 02, 2010 5:24 pm
by jimrecht
Super helpful as usual. Thank you John!