dbTalk Databases Forums  

Another Simple Question

comp.databases.filemaker comp.databases.filemaker


Discuss Another Simple Question in the comp.databases.filemaker forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Railman
 
Posts: n/a

Default Another Simple Question - 08-10-2005 , 06:42 PM






Is there a script that can be used to prevent changes on a record once
it has be entered? I am looking for a set of buttons Lock and Unlock
that will prevent careless changes in a record.
--
Never trust a skinny cook.


Reply With Quote
  #2  
Old   
Matt Wills
 
Posts: n/a

Default Re: Another Simple Question - 08-10-2005 , 08:24 PM






Railman wrote:

Quote:
Is there a script that can be used to prevent changes on a record once it
has be entered? I am looking for a set of buttons Lock and Unlock that
will prevent careless changes in a record.
Use global fields to enter the data, with a script that transfers the data
to the appropriate regular fields. Compare the globals with the regulars
in the script, aborting the transfer if the regulars are already populated.

Matt


Reply With Quote
  #3  
Old   
Helpful Harry
 
Posts: n/a

Default Re: Another Simple Question - 08-11-2005 , 01:27 AM



In article <eNxKe.5659$lK2.2795@trndny01>, "Matt Wills" <I'm (AT) Witz (DOT) end>
wrote:

Quote:
Railman wrote:

Is there a script that can be used to prevent changes on a record once it
has be entered? I am looking for a set of buttons Lock and Unlock that
will prevent careless changes in a record.

Use global fields to enter the data, with a script that transfers the data
to the appropriate regular fields. Compare the globals with the regulars
in the script, aborting the transfer if the regulars are already populated.
You can also use two separate layouts - one for the "locked" fields
(Allow Data Entry is turned off) and one for "unlocked" fields (Allow
Data Entry is turned on). Then the "Unlock" and "Unlock" buttons simply
swap to the appropriate layout.

BUT, this way you also have to use the "unlocked" layout to perform
finds.

The way around this is similar to the Global method Matt mentions
above. Have a duplicate set of fields which are simply Calculation
fields that are set to equal the original field.
ie.
locked_MyField = MyField

Then place the Calculation fields on the "locked" layout and you don't
have to worry about the "Allow Data Entry since nobody can change a
Calculation field manually, which means you can still use the "locked"
layout for perorming finds. The "unlocked" layout on the other hand has
the normal fields on it which can be changed. )



Helpful Harry
Hopefully helping harassed humans happily handle handiwork hardships ;o)


Reply With Quote
  #4  
Old   
Shadenfroh
 
Posts: n/a

Default Re: Another Simple Question - 08-11-2005 , 06:36 AM



In 7, create a flag to indicate whether the record is locked. Set access
privileges so that records that are locked cannot be edited/deleted
("Limited"). Create a button script that runs with full access to
unlock/lock the record.

Of course, you may not be in FM7...

I had a (somewhat) similar need on a solution I did a couple of years ago.
It was a requirement on many screens, so we worked out a system:

In each relevant table, there's a flag to indicate whether the record is
locked for editing. Call it f_locked, where 1 means it's locked. Set access
privileges to not allow editing of a locked record. Simple enough, except
that if the user can't edit the record, s/he can't unlock it.

So, in a separate table, constant relationship, where globals are stored (we
called ours System), there's a second lock field. It's a global flag we'll
call f_systemlocked, again where 1 means it's locked. (This acts as an
override, so that via script you can temporarily remove the locking
restrictions from the whole system, do your thing, and then lock the system
back up.) Set those access privileges to allow editing where f_locked <> 1
OR system::f_systemlocked <> 1.

A script to lock/unlock a locked record performs the following pseudocode:

allow user abort (off)
if f_locked <> 1
set field f_locked, 1
else
set field system::f_systemlocked, ""
commit
set field f_locked, ""
set field system::f_systemlocked, 1
end if

Don't give the users direct access to either of the flag fields.

--

Shadenfroh
shadenfroh (AT) yahoo (DOT) com

"Railman" <railman (AT) sasktel (DOT) net> wrote

Quote:
Is there a script that can be used to prevent changes on a record once
it has be entered? I am looking for a set of buttons Lock and Unlock
that will prevent careless changes in a record.
--
Never trust a skinny cook.




Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.