Function overview
Prototype
AllowInputInAutoEnter (
_self; _value; _triggers )
Parameters
_self set it to Self
_value the value to insert in the field if it is not the current field. Usually defined by a calculation.
_triggers simply reference the fields that should trigger the function if the _value calculation doesn't refer them already.
Description
Tags:
Interface auto enter
Use in reevaluating auto-enter calculations to allow the user to input something in the field without it to re-evaluate and erase the user entered value. No need to hard code the field name anymore!
Examples
Sample input
AllowInputInAutoEnter ( Self ; anotherField ; "" )
Sample output
returns Self if the field is active
or the content of anotherField if it is not
Function code
/*
AllowInputInAutoEnter ( _self ; _value ; _triggers )
by Fabrice Nordmann & Tanguy Collès
v.2 - Mar 22 2009
- added the _triggers parameter
v.1 - Feb 27 2009
REQUIRES FileMaker 10
Use in reevaluating auto-enter calculations to allow the user to input something in the field without it to re-evaluate and erase the user entered value. No need to hard code the field name anymore!
- _self parameter should always be set to Self
- _value is the value (normally defined by a calculation) to insert when the field is not the active field
- _triggers is optional (else, leave empty ""), you can simply list the fields that should trigger the function, if they are not referenced by the _value calculation.
*/
Case (
GetFieldName ( _self ) = Get ( ActiveFieldTableName ) & "::" & Get ( ActiveFieldName ) & Case ( Get ( ActiveRepetitionNumber ) > 1 ; "[" & Get ( ActiveRepetitionNumber ) & "]" )
; Get ( ActiveFieldContents )
; _value
)
// ===================================
/*
This function is published on FileMaker Custom Functions
to check for updates and provide feedback and bug reports
please visit http://www.fmfunctions.com/fid/209
Prototype: AllowInputInAutoEnter( _self; _value; _triggers )
Function Author: Fabrice (http://www.fmfunctions.com/mid/37)
Last updated: 15 May 2009
Version: 2.1
*/
// ===================================
/*__LITBR__AllowInputInAutoEnter ( _self ; _value ; _triggers )__LITBR____LITBR__by Fabrice Nordmann & Tanguy Collès__LITBR____LITBR__v.2 - Mar 22 2009__LITBR__ - added the _triggers parameter__LITBR__v.1 - Feb 27 2009__LITBR____LITBR__REQUIRES FileMaker 10__LITBR____LITBR__Use in reevaluating auto-enter calculations to allow the user to input something in the field without it to re-evaluate and erase the user entered value. No need to hard code the field name anymore!__LITBR__- _self parameter should always be set to Self__LITBR__- _value is the value (normally defined by a calculation) to insert when the field is not the active field__LITBR__- _triggers is optional (else, leave empty ""), you can simply list the fields that should trigger the function, if they are not referenced by the _value calculation.__LITBR____LITBR__*/__LITBR____LITBR____LITBR__Case (__LITBR__GetFieldName ( _self ) = Get ( ActiveFieldTableName ) & "::" & Get ( ActiveFieldName ) & Case ( Get ( ActiveRepetitionNumber ) > 1 ; "[" & Get ( ActiveRepetitionNumber ) & "]" )__LITBR__; Get ( ActiveFieldContents )__LITBR__; _value__LITBR__)__LITBR____LITBR__// ===================================__LITBR__/*__LITBR____LITBR__ This function is published on FileMaker Custom Functions__LITBR__ to check for updates and provide feedback and bug reports__LITBR__ please visit http://www.fmfunctions.com/fid/209__LITBR____LITBR__ Prototype: AllowInputInAutoEnter( _self; _value; _triggers )__LITBR__ Function Author: Fabrice (http://www.fmfunctions.com/mid/37)__LITBR__ Last updated: 15 May 2009__LITBR__ Version: 2.1__LITBR____LITBR__*/__LITBR__// ===================================
Login or register to comment
Create a new account with fmcustomfunctions.com or login to post a comment.
Comments
28 February 2009
I dont understand when this function is useful. What problem is it solving?
Oreste
28 February 2009
up to FileMaker 9, if you had a field with an auto-enter calculation referring another field BUT wanted to leave the user input something in the field, you had to hard code the field name in the calc.
e.g. Case ( Get ( ActiveFieldName ) = "fieldName" ; Self ; calculation )
with FM_Name_ID (which you can find on this site), there was already a way to avoid hard-coding, but it was a little overkill in this situation.
Now with FM 10 you don't have to hard code the field name anymore.
01 March 2009
01 March 2009
it seems that I can't be clear enough with words, so here is a little sample where I used a very classical inchs <-> centimeters conversion challenge.
http://fabrice.nordmann.free.fr/customfunctions/AllowInputInAutoEnter.fp7
Looking forward to your feed-back :)
01 March 2009
10 May 2009
Hope it makes it clearer.