dbTalk Databases Forums  

Script that locks fields

comp.databases.filemaker comp.databases.filemaker


Discuss Script that locks fields in the comp.databases.filemaker forum.



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

Default Script that locks fields - 05-18-2007 , 03:13 AM






Hi,

I would like to make a script that locks fields for a particular record,
so that no data can't be entered any more. How can I obtain this?

It is important to do this through a script. Data can be entered first,
but after a validation script they should be locked.

I use FMP 8.5.

Thanks in advance for any help.

Kind regards,
Hans Puype
Belgium

Reply With Quote
  #2  
Old   
eyebrown@mindspring.com
 
Posts: n/a

Default Re: Script that locks fields - 05-18-2007 , 06:24 AM






In article <1hyb06f.alq4tlaeodeiN%hpuype (AT) gmail (DOT) com>, hpuype (AT) gmail (DOT) com
(Hans Puype) wrote:

Quote:
Hi,

I would like to make a script that locks fields for a particular record,
so that no data can't be entered any more. How can I obtain this?

It is important to do this through a script. Data can be entered first,
but after a validation script they should be locked.
By "locking", I suppose you mean to stop allowing users access, that is,
clicking the "allow entry" checkbox in field format. I don't think you
can do that with a script.

However, you could make a global field that the users enter their data
into. Then they click a "commit" button which would set the real field
from the global, then clear the global. If the criteria for no longer
allowing data entry are satisfied, this same script could set a hidden
control field from zero to one. The script would begin with a test of
this control field. If it contains a one, then a message pops up, "You
are no longer allowed to enter data in this field", the global is cleared
and the script exited.

Steve Brown


Reply With Quote
  #3  
Old   
Howard Schlossberg
 
Posts: n/a

Default Re: Script that locks fields - 05-18-2007 , 10:08 AM



Have your script change a Locked_Flag field. In the file's Accounts &
Privileges, create a custom calc for editing and deleting that only
allows the changes if the Locked_Flag field has not been set.


Hans Puype wrote:
Quote:
Hi,

I would like to make a script that locks fields for a particular record,
so that no data can't be entered any more. How can I obtain this?

It is important to do this through a script. Data can be entered first,
but after a validation script they should be locked.

I use FMP 8.5.

Thanks in advance for any help.

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

Default Re: Script that locks fields - 05-18-2007 , 06:24 PM



In article
<eyebrown-1805070726380001 (AT) 209-42-139-101 (DOT) earthlink.wispnet.net>,
eyebrown (AT) mindspring (DOT) com wrote:

Quote:
In article <1hyb06f.alq4tlaeodeiN%hpuype (AT) gmail (DOT) com>, hpuype (AT) gmail (DOT) com
(Hans Puype) wrote:

Hi,

I would like to make a script that locks fields for a particular record,
so that no data can't be entered any more. How can I obtain this?

It is important to do this through a script. Data can be entered first,
but after a validation script they should be locked.

By "locking", I suppose you mean to stop allowing users access, that is,
clicking the "allow entry" checkbox in field format. I don't think you
can do that with a script.

However, you could make a global field that the users enter their data
into. Then they click a "commit" button which would set the real field
from the global, then clear the global. If the criteria for no longer
allowing data entry are satisfied, this same script could set a hidden
control field from zero to one. The script would begin with a test of
this control field. If it contains a one, then a message pops up, "You
are no longer allowed to enter data in this field", the global is cleared
and the script exited.
The Global field approach is one way.

A slightly easier way (from the users' perspective) would be to have a
second field "Record Locked" that can be turned on and off by whoever /
whatever process is required.

All the other fields can then be set to act as a button that runs a
script along the rough lines of:

If [Record Locked = "Unlocked"]
Go To Field [{field clicked}]
Else
Message ["Sorry, record is locked."]
End If

In older versions of FileMaker you would need a separate script for
each field, but in newer version you can have a single script and use
the script parameters to let it know which field was clicked in.

OR you can have a second layout where all the fields are locked, but
then you have to create your own record navigation and find scripts as
well so that users are sent to the appropriate locked or unlocked
layout according to the record's "Record Locked" value.



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


Reply With Quote
  #5  
Old   
Hans Puype
 
Posts: n/a

Default Re: Script that locks fields - 05-19-2007 , 01:49 AM



Howard Schlossberg <howard (AT) nospam (DOT) fmprosolutions.com> wrote:

Quote:
Have your script change a Locked_Flag field. In the file's Accounts &
Privileges, create a custom calc for editing and deleting that only
allows the changes if the Locked_Flag field has not been set.


Hans Puype wrote:
Hi,

I would like to make a script that locks fields for a particular record,
so that no data can't be entered any more. How can I obtain this?

It is important to do this through a script. Data can be entered first,
but after a validation script they should be locked.

I use FMP 8.5.

Thanks in advance for any help.

This is the solution I need. Thank you!

Hans


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.