Re: FORMS 4.5 -- Want to update multiple records with button

From: Steve Hauser <shauser_at_wat.hookup.net>
Date: 1995/12/19
Message-ID: <4b5cgg$73_at_nic.wat.hookup.net>#1/1


"John N. Zeigler" <zeigler> wrote:

>I have a master-detail relationship which displays 1 master record and 5 detail
>records. The only detail field that will be getting updated is a check box.
>If the user wants all of the boxes checked, I would like a button trigger to
>do this and then immediately display all the boxes as checked. I haven't found
>a way to do this except by doing an UPDATE in the trigger. This will not
>display the changes however. I have to do another query to display the update.
>Thanks

Remember that you should be careful when doing manual SQL within Forms, since the built-in code to handle locked records is bypassed (coding an UPDATE within Forms will stall your form if another user has that record locked - it's OK if you're sure that nobody else will ever have those records locked)

As far as changing multiple records within one button, I would navigate to the detail block, and then proceed to loop through all the records with first_record and next_record navigation, while setting the checkbox. Note that this will fire many record-level and item-level triggers for each record, so it could be slow if you're doing a lot of work in those triggers. But if it's really, really slow and you had no other alternative, you could go brute force and use a flag and put IF statements in each of those triggers to bypass the slow code (yuk).


Steve Hauser,        \  CGI Group            \  Business Solutions  
Partner, Consultant   \  33 Yonge St          \  Through Information
                       \  Toronto, ON, Canada  \  Technology        
shauser_at_wat.hookup.net  \  M5E-1G4              \                   
Received on Tue Dec 19 1995 - 00:00:00 CET

Original text of this message