dbTalk Databases Forums  

Non-modifiable field

comp.databases.filemaker comp.databases.filemaker


Discuss Non-modifiable field in the comp.databases.filemaker forum.



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

Default Non-modifiable field - 10-27-2006 , 02:27 PM






Hello,

I need to create a field that I can enter the data but one time the
data is there no body can modify.
I was looking with the passwords but I'm not sure. If somebody else has
a better idea please let me know.

Thanks for all your help.


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

Default Re: Non-modifiable field - 10-27-2006 , 04:55 PM






In article <1161977275.218964.66760 (AT) f16g2000cwb (DOT) googlegroups.com>,
"Darwin" <darwin (AT) gsiskylights (DOT) com> wrote:

Quote:
Hello,

I need to create a field that I can enter the data but one time the
data is there no body can modify.
I was looking with the passwords but I'm not sure. If somebody else has
a better idea please let me know.

Thanks for all your help.
There's two approaches without the need for passwords and privileges.

A. Separate New Record and Browse
Create two layouts. One is used to enter new records, perhaps
using temporary Global fields and scripting the transfer to a
real record. The other layout is used when browsing records
where the data in the fields can not be changed by turning off
the "allow entry" option in the Format.

The problem here is that you will also need a layout (possibly
the same one used to add new records) to be able to perform Finds.

B. Field Validation
Create a second hidden field that is given a copy of the original
field's data by an auto-enter calculation. You can then set the
validation options of the original field to not allow any change.
ie.
OriginalField {Text, Number, whatever}
Validated by calculation,
Strict (Do not allow user to override)
= IsEmpty(CopyField) or (OriginalField = CopyField)

CopyField {Text, Number, whatever}
Auto-enter by calculation
= If(IsEmpty(OriginalField), "", OriginalField)

After the user enters some data into the OriginalField a copy
is put into the CopyField. If they then later try to change the
data the two fields no longer match and so cause the validation
to fail (you can use a custom message to tell them why). The field
is still able to be entered into for Find mode.

There is a possible hiccup here. If the user enters data into the
OriginalField, goes to another field and then returns to fix a
mistake in the OriginalField before committing the record - they
won't be allowed to.


You'll also need some way to work around this "do not change" block
since there's ALWAYS going to be one occasion where you discover you
have to be able to change the data. The easiest way is to have a new
layout where for each method above:

A. Layout has normal versions of all fields that can be changed.

B. Layout has the hidden second field so you can change both
OriginalField and CopyField.

This new layout can be set not to show up in the Layouts menus and are
therefore hidden to normal users. The only way to get to them is via
Layout mode.





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


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.