Using an Invoice, entry form, as an example.
This assumes all relations are Manual relations
(NOTE: all 'code' written in the email - not really code)

you would call a relation command in on load 
You would do this only if there is only 1 related table, or you want 
ALL related tables to load their data
:(Form event = on load)
  relate many([Invoice_Items]Invoice_id)
You can optionally use a query to get only those 'related' records for 
one related table
:(Form event = on load)

if you have 2 or more tables of related data you are displaying for the 
Invoice items
Shipping addresses
Payments received
When Invoices were sent

*I* would create a method to be called from the tab control** 
   invoice_Manage_Tab (longint : Tab 'page' being displayed)
In this method I would do the appropriate query to locate the needed 
'related' records based on which tab was being displayed (given the 
above related table list and order).
The Tab manager may do more then just locate records, depending on the 
way in which you are displaying the related records. It could load 
arrays if you are using an array based listbox, it could setup columns 
if you are using a selection based listbox, it could do calculations 
(sum of invoice items for example). THis would depend on the data being 
displayed and interface being used.
tab 1 - invoice items
tab 2 - Shipping addresses

In the form method
:(form event = on load)
  invoice_Manage_Tab(1)  `loads invoice items for display
** - table control - allows user to switch between different related 
table views

Calculations (such as Invoice Item total)
this can be done in a few places - again depending on interface and 
what control the user has on what is displayed.
- In the tab manager, if the user can not change the display 
- in the On Display Detail event (listbox, 4d view(?), (included) sub 
- in the footer (listbox, 4D view(?), (included) sub form)

Note: I do not, have not used 4D view so I do not know what options are 

On Thu, 13 Oct 2016 20:28:25 -0300, pk wrote:
> I am still understanding the manual relations (as chip mentioned), 
> and which events to use where for totals,
4D Internet Users Group (4D iNUG)

Reply via email to