AllowInputInAutoEnter ( )

Function stats

Average user rating
4.0000
37
209
9999
Support
FileMaker 10.0 +
Date posted
28 February 2009
Last updated
15 May 2009
Version
Recursive function
No

Author Info
 Fabrice

74 functions

Average Rating 4.4

author_avatar



 

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

*/
// ===================================

 

Comments

kaostika
28 February 2009



HI,

I dont understand when this function is useful. What problem is it solving?

Oreste
  General comment
Fabrice
28 February 2009



Hi,
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.
  General comment
BruceR
01 March 2009



Uh, could you try that again? I still can't understand what this does.
  General comment
Fabrice
01 March 2009



Hi Bruce,
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 :)

  General comment
kaostika
01 March 2009



I think i understand. If the auto enter calc is based on the value of another field, when something changes the value changes. This function affects that some how.
  General comment
Fabrice
10 May 2009



Forgot to mention that I posted a file here : http://www.bh-a.com/downloads/index.html
Hope it makes it clearer.
  General comment

 

 

 

 

 

Top Tags

Text Parsing  (33)
List  (31)
Date  (28)
XML  (26)
Format  (23)
Sql  (22)
Dev  (20)
Debug  (17)
Interface  (15)
Layout  (15)
Text  (14)
Variables  (12)
Layout Objects  (11)
Filter  (11)
Design  (10)
Array  (7)