GetFoundSet ( FieldName )
Gets a field's value across either the current found set or related records
Average rating: 4.6 (43 votes) Log in to vote
Howard Schlossberg - Show more from this author
FM Professional Solutions http://fmprosolutions.com |
GetFoundSet ( "LineItems::ItemName" )
Chair¶Table¶Pencil¶Paper
Function definition: (Copy & paste into FileMaker's Edit Custom Function window)
Gets a field's value across either the current found set or related records. This was written when custom functions first became available, before the List() function was added to FileMaker. The remaining value of this function, though, is its ability to work across the local found set.
NOTES:
1) Fieldname MUST be in quotes
2) For related fields, use entire field path (i.e. "TO::fieldname")
3) For local fields (current found set), use field name only (i.e. "fieldname")
Comments
Yannick Van den Eijnden, Antwerp Jul 29, 2010 |
||
Nice function, thanks for adding this | ||
Martin Inchley, Christchurch, UK Nov 16, 2012 |
||
Using quotes to enclose a field name will give problems should you ever need to change the name of the field. To future-proof it I use the Evaluate function, together with the complete name of the target field: GetFoundSet ( Evaluate ( "\"" & Right ( GetFieldName ( TO::FieldName ) ; Length ( GetFieldName ( TO::FieldName ) ) - Position ( GetFieldName ( TO::FieldName ) ; "::" ; 1 ; 1 ) - 1 ) &"\"" ) ) This resolves to the current short name of the field in quotes. Thanks for the function, Howard – very useful. |
||
Tux, Montreal Jan 21, 2014 |
||
Using this function different times during the same session on the same found set seems to alternate correct and incorrect results. Something to do with leaving $$TotalCount or $$RecCount set? Anyone else run into this? |
||
StevenZLi, Ohio Apr 28, 2014 |
||
One problem I did notice is that the behavior of "Count" and "Get(FoundCount)" are different. For "Count", empty values are not included, and you get a smaller number if there are empty values - thus retrieve less values. This may only be a problem if you're trying to retrieve data in a field from related table that contain empty cells. |
||
Note: these functions are not guaranteed or supported by BrianDunning.com. Please contact the individual developer with any questions or problems.