Software Venture Consulting

FileMaker Pro downloads & Resources
FileMaker Custom Functions
FileMaker Web Viewer Examples
FileMaker Pro & Lasso Consulting
Training
FileMaker Books
FileMaker Articles
FileMaker Error Reference

Free Web Tools
Free FileMaker Tools

Personal Pages
Videos
Adventures
Links

Shopping Cart
Shopping Cart

Search:

Free Newsletter
Signup


Contact


Privacy Policy



FileMaker is a registered trademark of FileMaker, Inc. in the U.S. and other countries.

 

 FileMaker Pro Custom Functions

List  |  Show Random  |  Upload  |  Add This to Your Site

GetRecordNumber ( _field ; _value )

Rate this function:  

RatingRatingRatingRatingRating
  Average rating: 3.8  (19 votes)
  Discuss this Custom Function

Gary Czychi, GC Consulting
czychi.com

Given a field value, returns its current Record Number within the current Found Set

Sample Input:
GetRecordNumber ( author::name ; "Douglas Adams" )
Sample Output:
42


 Then copy & paste into FileMaker Advanced's Edit Custom Function window.

Click here to copy To Clip Manager if you have myFMbutler's Clip Manager installed

Description:

Returns the first line number that contains _value, of a list of _field values of all records in the current found set
Returns NULL ("") when _value is not in the list
Returns the correct line number , no matter whether the found set is sorted or not !
=> which is IDEAL for Go To Record/Request/… script step

If it doesn't work, you probably not calling it with a field reference, but with a field value:
_field is a field reference, not a value:
If the field name is stored inside a field, use Evaluate ( ) => GetRecordNumber ( Evaluate ( g::tmpT ) ; g::tmpN )

Based on the ListValues ( Field ) recursive function from Koji Takeuchi:
Given the list of Koji Takeuchi, added number strings at the beginning of each line, followed by a tab character and the line value
At the end, searches for a tab, the _value and reads its line number, then returns the line number

Sample:
GetRecordNumber ( author::name ; "Douglas Adams" )
=> Returns the number 42 (if the record with "Douglas Adams" is the 42nd record in the current found set).

Note: these functions are not guaranteed or supported by BrianDunning.com. Please contact the individual developer with any questions or problems.

This is my Custom Function and I want to edit it

Discuss:

Undefined Null is used in this function.
I tried replacing it with "", but not get result.

unix, Japan
March 29, 2016 6:38pm

Hi,

sorry about the «Null» function, you're right. I already changed it to "", which is the exact same thing, as you have done. I use the Null function because it makes for much better reading and understanding of code afterwards.

If it still doesn't work, you are probably not calling the function with a field reference, but with a field value (whereas the _value is a value):
_field is a field reference (not a value):
If the field name, for example «author::name» is stored inside of a field, use Evaluate ( ) => GetRecordNumber ( Evaluate ( g::tmpT ) ; g::tmpN )

This will probably do it.

Thanks for your question. Now, it should be clearer.

Gary

Gary, DÜsseldorf, Germany
March 29, 2016 7:58pm

Make a comment about this Custom Function (please try to keep it brief & to the point). Anyone can post:

Your Name:
City/Location:
Comment:
characters left. If you paste in more than 1500 characters, it will be truncated. Discuss the function - advertisements and other useless posts will be deleted.
Answer 7 + 8 =
Search for Custom Functions:

Custom Functions Widget
Download the Custom Function Dashboard Widget for OS X
Keep all the latest Custom Functions right at your fingertips!

Newest Custom Functions:

1. decFromHex ( hexValue )
  (Mon, Oct 16, 12:34pm)
2. MonthYearList ( startmonth ; startyear ; numbermonth ; short )
  (Mon, Oct 16, 3:38am)
3. ErrorDescription ( errorNumber )
  (Wed, Sep 27, 2:51am)
4. decodeEntities (text)
  (Wed, Sep 27, 1:22am)
5. HexidecimalToNumber ( HexidecimalValue ; counter )
  (Mon, Sep 25, 12:39pm)
6. FixedFieldConverter ( Fieldname ; f1 ; f2 ; f3 ; f4 ; f5 ; f6 ; f7 ; f8 ; f9 ; f10 ; f11 ; f12 ; f13 ; f14 ; f15 ; f16 ; f17 ; f18 ; f1
  (Fri, Sep 15, 12:34pm)
7. ShannonEntropy ( text )
  (Thu, Sep 07, 5:59am)
8. LetterCount ( text ; summary )
  (Thu, Sep 07, 5:53am)

RSS Feed of Custom Functions