FMPRO-L Archives

January 2012, Week 1

FMPRO-L@LISTSERV.DARTMOUTH.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Helping Hand Database Design <[log in to unmask]>
Reply To:
FileMaker Pro Discussions <[log in to unmask]>
Date:
Mon, 2 Jan 2012 19:00:29 -0500
Content-Type:
Text/Plain
Parts/Attachments:
Text/Plain (93 lines)
Nice! Thank you.
Laura Z.






---- On    , Jason DeLooze ([log in to unmask]) wrote:

The only improvement I would suggest to Danny's response is, in
the "if error branch", put the "Commit Records //releases locked
portal rows" before the "Show Dialog".  Doing so will reduce any
locked record conflicts with other users.

Jason


On 12/30/11 at 11:28 AM -0500, Danny Mack wrote:
> In a portal:
> 
> Loop
> Open Record
> If [LastError]
> Show Dialog: "A required record is not available."
> Commit Records //releases locked portal rows
> Exit Script
> End If
> Go to Portal Row (Next, Exit After Last)
> End Loop
> Replace
> Commit Records
> 
> That's the basic idea. 
> 
> Alternately, you can loop through the portal and set fields
instead of using Replace. Test for an error after the Set Field
step. Then no pre-emptive Open Record step is necessary. Add a
Commit Records step at the end. You can test for an error after
the Set Field (if you have multiple Set Fields, you only need to
test for an error after the first Set Field). The first Set
Field opens the record if possible. If it returns an error then:
> Revert Record
> Then none of the Set Fields will be committed.
> 
> Danny
> 
> 
> 
> On Dec 30, 2011, at 11:01 AM, Helping Hand Database Design 
wrote:
> 
>> Hi,
>> Not trying to hijack or anything, but on the record locking
>> looping commentary, if I might ask. How best to lock a group
of
>> records in the script before zapping it with a replace?
>> Thanks,
>> Laura Z.
>>
>>
>>
>>
>>
>> ---- On    , Todd Geist ([log in to unmask])
wrote:
>>
>> One further refinement :-)
>>
>> On Tue, Dec 27, 2011 at 5:30 AM, Corn Walker  wrote:
>>
>> One refinement is that entering a field is no longer
sufficient
>> to lock a
>>> record. You should use the Open Record[] command to do so,
>> which should
>>> return error 301 if the record is in use.
>>
>>
>> Don't just check for a 301 error. Check for any error. If any
>> error occurs
>> you didn't open the record. So check for Get(LastError) = 0.
If
>> it is 0,
>> your safe. If it is not 0, your not.
>>
>> For example, Record Level Access would also stop a script
from
>> opening the
>> record and it does not return 301. It returns 200.
>>
>> Todd

ATOM RSS1 RSS2