Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Multiple table updates
Message
 
To
02/05/2000 11:23:12
Bill Breay
Custom Business Software
Arvada, Colorado, United States
General information
Forum:
Visual FoxPro
Category:
The Mere Mortals Framework
Miscellaneous
Thread ID:
00365107
Message ID:
00365341
Views:
16
>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'.
>

I'd use an event. Each of your views should have it's own bizobj associated with it. In the DefineParticipatingEntities() add the references to all of the objects (the manual covers the specifics of it). In the ExecuteEvent() method you would add code that would do something like:

lcAliasA = oBizObjA.GetAlias()
oBizObjA.New()
SELECT (lcAliasA)
* Update whatever fields you need to
REPLACE field WITH newvalue
oBizObjA.Save()

*** Do the same for the other two bizobjs.

Then I'd drag this event onto the main form and set it's lAutoExecuteEvent property to .F. . From the primary bizobj that is supposed to kick off the event, add a call to your event from someplace like the PreSaveHook() in the bizobj. Eg.: THISFORM.MyEvent.ExecuteEvent()

You could also just create/execute the event with:

LOCAL loEvent

loEvent = CreateObject("MyEvent")

in the method, without actually adding it to the form, but I've had better luck with it on the form instead.

HTH
-Paul

RCS Solutions, Inc.
Blog
Twitter
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform