Mombu the Programming Forum sponsored links

Go Back   Mombu the Programming Forum > Programming > Frustration with auto-enter fields
User Name
Password
REGISTER NOW! Mark Forums Read

sponsored links


Reply
 
1 10th December 10:18
helpful harry
External User
 
Posts: 1
Default Frustration with auto-enter fields


I'm positive that this is how auto-enter fields work, before Filemaker
7 anyway.

Normal fields using "auto-enter" options (whether that's data,
calculation, lookup, etc.) only get their data when the record is
created ... OR by a bit of trickery, when the fields they're based on
get data. Obviously this last option doesn't work when using the Data
option, since that's hard-coded into the field's definition.

These fields can have this initial data over-ridden / changed by later
data entered by the user, a script, etc., but it can't change
automatically simply when any of the fields it's based on are changed -
that's what Calculation fields are for.

For Filemaker 7 and onwards, I have no real idea, but such a drastic
change in the ability would break quite a few existing databases so I
doubt it's changed THAT much.

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


  sponsored links


2 10th December 10:25
dan
External User
 
Posts: 1
Default Frustration with auto-enter fields


I cannot say what the situation was in earlier versions than 7 but I can
say that Auto-enter is really too mild a description for what is
possible now. Auto-update would be a better name in some cases..

A simple example put on a forum by "Queue" demonstrating conversion from
inches to centimeters and vice-versa was the trigger as far as I was
concerned

Make Cent a number with an auto-enter calculation, and 'do not replace
existing value' deselected, of

If( Get(ActiveFieldName) = "Inch"; 2.54 * Inch; Cent )

Similarly, make Inch an auto-enter calc, with 'do not replace existing
value' deselected, of

If( Get(ActiveFieldName) = "Cent"; Cent / 2.54; Inch ) .

Enter a value into one of these fields and it is automatically converted
into the other.

I've extended this idea in one of my solutions to do auto-updating
calculations between Net, Tax,Gross and including taking into account
TaxRate changes; but the possibilities are endless.


--
Dan
Using
FMP7.03, WinXP SP2
  Reply With Quote
3 10th December 10:33
helpful harry
External User
 
Posts: 1
Default Frustration with auto-enter fields


OK, so you enter a Cent data value and Inch auto-enter the converted
value ... BUT, what happens if you the change the value of Cent (or
Inch for that matter)??

In pre-7 versions of FileMaker the auto-enter field would stay with the
original value.

If in version 7 they can now alter their own values (presumably
user-definable to allow compatibility with older versions) when the
source field changes, then they're sort of a cross between normal
fields and Calculation fields - they automatically change if the source
field changes, but can also be manually entered into. That is useful in
some situations (in pre-7 versions you have to do a workaround), but it
makes pure Calculation fields a bit redundant - you would simply use
one of these new-fangled "auto-update" fields and turn off the 'allow
changes' option.

Helpful Harry
Hopefully helping harassed humans happily handle handiwork hardships ;o)
  Reply With Quote
4 10th December 10:35
howard schlossberg
External User
 
Posts: 1
Default Frustration with auto-enter fields


This is exactly the discussion going on in another group I belong to:
"can auto-enter calcs replace true calcs". Jury's still out on this,
but probably not. Just like a stored calc, an auto-enter calc requires
one of its field parameters to change in order to trigger the calc
itself to change. So if you have a calc of:

case(a=b+c, d, e)
then a, b or c would need to change in order for the new value of either
d or e to fill in. But if you want the calc to update when 'f' changes,
then you need to include 'f' in the calc, something like:

case(f="Never", "Nothing", a=b+c, d, e)
This will always force itself to re-evaluate whenever f changes,
assuming that f will never be equal to "Never". If f changes and it is
something other then "Never", then it will evaluate a=b+c and result in
either d or e.

There are other tricks to getting around the trigger problem, to have
the calc re-evaluate itself every time the record is committed, for
example, by having it evaluate the 'last modified time'.

So in this way, an auto-enter calc can behave just like a stored calc
field, and almost like a lookup field. With the LookupNext() function,
it can behave exactly like a lookup field.

A benefit to the auto-enter calc over a regular stored calc is that the
auto-enter can contain the value of related fields. But like a stored
calc, an auto-enter calc cannot be triggered by a related field as its
parameter. In other words, the related value can be part of the result,
but changes to the related field itself will not trigger the calc to
refresh, even if that related field is part of the parameter.

Hope this is all somewhat enlightening to someone...

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Howard Schlossberg (818) 883-2846
FM Pro Solutions Los Angeles, California

FileMaker 7 Certified Developer
Associate Member, FileMaker Solutions Alliance
  Reply With Quote
5 18th December 16:08
helpful harry
External User
 
Posts: 1
Default Frustration with auto-enter fields


Clear as mud. ;o)

That sort-of makes sense, but I think I'd have to play with some
examples before I really understood it fully ... if I ever have to
upgrade my version of FileMaker.

Hopefully they can still work the "normal" way as well using some
checkbox option so that the auto-enter calculation doesn't update at
all even if the source fields do. Otherwise it'll break some databases
that rely on the old way auto-enter fields work.

Helpful Harry
Hopefully helping harassed humans happily handle handiwork hardships ;o)
  Reply With Quote
6 18th December 16:35
dan
External User
 
Posts: 1
Default Frustration with auto-enter fields


Hi Harry

Yes they do work in the normal way if you select Do Not Replace Existing
Contents if any which, if I recall correctly, is the default option in
v7 when you select a calculated Auto-enter.

I have converted some v3 files without any problem - although I confess
I am looking carefully at them to see if there is room for updating the
Auto-enters.


--
Dan
Using
FMP7.03, WinXP SP2
  Reply With Quote
7 26th February 08:41
usenet@greenknight.org.uk.invalid (catja
External User
 
Posts: 1
Default Frustration with auto-enter fields


You could also define a lookup (and then relookup for the whole lot) or
an unstored calculation to get a value into the field.

Replace, in the case of an administrative field doesn't look too
dangerous - just don't say 'yes' to the dialogue without reading it
carefully.


From the overworked department of Scripting Errors You Never Want To
See:


"Filemaker is replacing in all 88765 records..."


(Luckily it was only a tracking device - but I was cursing the thing to
high heaven because *it wouldn't stop*.)


Catja
  Reply With Quote


  sponsored links


Reply


Thread Tools
Display Modes




Copyright 2006 SmartyDevil.com - Dies Mies Jeschet Boenedoesef Douvema Enitemaus -
666