Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Multiple table updates
Message
De
02/05/2000 11:23:12
Bill Breay
Custom Business Software
Arvada, Colorado, États-Unis
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
The Mere Mortals Framework
Titre:
Multiple table updates
Divers
Thread ID:
00365107
Message ID:
00365107
Vues:
53
Hi All,

This issue is about adding/updating a master table 'Master''. Changes or additions to the numeric field of master table 'Master' require a record be added/updated in transaction table 'A', which in turn will be updated to table 'Master', and a log record of the transaction data to be added to log table 'Log'. So there are 4 steps; 1) add/update descriptive info on the 'Master table; 2) create a transaction record of numeric field updates in table 'A'; 3) create a log of transactions in table 'Log'; and 4) update 'Master' with the data from table 'A'.

To accomplish this I have set up a cbizobjmaintenanceform with a clistonetomanyobj on page 1 with a bizobj for the 'Master' table. Page 2 are the property controls for table "Master". Page 3 is a clistobjedit with a bizobj for table "A" and calls a clistobjeditform for the properties of table "A".

The question is how to add to the record to the 'Log' table and update the numeric field in the 'Master table.

I have tried to set up a view that references all three tables thru joins but ran into complications with common field names in the different tables such as 'iid' is the field name of the id field in each table. These fields could be changed but I am not real pleased with using views with multiple tables.

I have tried to change the dataenvironment of the bizobj for table 'A' in its postsavehook to a dataenvironment for the 'Log' table, but ran into the issue where the postsavehook is instantiated between the 'begin transaction' and the 'end transaction' of the save process for the table 'A' update causing an error. I also tried to use this same process from the 'save' method of the bizobj and bumped into other problems.

I have considered three bizobjs on page 3, one each for the three tables (views) to be updated but am at a loss as how to instantiate them. The table 'A' bizobj would be the primary as the page is activated but what would be the process when table 'A' is finished? An answer may may be using an event but I am not sure of the syntax since the handling of these 3 functions is a sub event, if you will, of the maintenance of the master table 'Master'.

Any help would be appreciated.

TIA
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform