GetNthRecordSet ( fieldName ; recordNumStart ; recordNumEnd )
Rate this function: Average rating: 3.6 (29 votes) Discuss this Custom Function
Jonathan Mickelson, Thought Deveopment Corp.
http://thought-dev.com
Calculates a return delimited and sorted, values list from related, or local, field data.
Sample Input:
GetNthRecordSet ( Children::Name ; 1 ; "" ) == where 3 children's names exist, unsorted.
GetNthRecordSet ( FirstName ; 2 ; 4 ) == where 5 records in found set sorted by FirstName
|
|
Sample Output:
"Jimmy¶Suzzie¶Johnny"
"Luther¶Mike¶Suzzie"
|
|
Description:
Creates a return delimited value list of the values from the field specified, beginning with the recordNumStart and ending with recordNumEnd. The resultant value list's scope and sort are determined by the source field; thus for local fields the sort is determined by the current sort of records in the found set, for related fields it is by the relationship sort.
This single Custom Function can replace Copy All primary keys of a foundset practice as well as the use of ValueListItems() to create a value list of related values for other relationships.
Parameters:
fieldName - Any local field, related field, or an expression that returns a field. NOTE: For repeating fields this Custom function will only see the first repetition, per record. Also, Globals will behave similarly and the global will be display once for each record.
recordNumStart - The record number from which you want to begin getting data. A null ("") or 0 value will set the start at the first record.
recordNumEnd - The record number after which you want to stop getting data. A null ("") or 0 value will evaluate until the the last record is reached. This parameter is inclusive, thus 10 will end the value list with the 10th record, including the contents of the field in that record.
Output Format:
A return delimited text value list of the the contents of fieldName dictated by the provided start and end record numbers.
Note: The result of GetNthRecordSet() will not be updated when the record referred to by GetNthRecordSet() is a record other than the one in which the calculation is currently being evaluated.
Examples:
Given the following related Field data for Children::FirstNames:
Related Record 1 = Jimmy
Related Record 2 = Suzzie
Related Record 3 = Johnny
Related Record 4 = Dweezle
GetNthRecordSet ( Children::FirstNames ; 1 ; 3 ) = Jimmy¶Suzzie¶Johnny
GetNthRecordSet ( ParentFirstName ; "" ; "" ) = Value list of all parent names in current found set, in sort order
GetNthRecordSet ( ParentFirstName ; 30 ; "" ) = Value list beginning with the 30th parent name till the last record in current found set, in sort order.
Special Thanks: To Ray Cologon, for refining the IsValid test instead of a cumbersome case test and his ubiquitously simplified code ideas!
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:5 most recent comments | Show all 6 comments Make a comment about this Custom Function (please try to keep it brief & to the point). Anyone can post:
|
Newest Custom Functions:
| 1. |
list.intersect (listA; listB) |
| |
(Mon, May 14, 12:43pm) |
| 2. |
WeekStart ( weekOfYear ; year ) |
| |
(Sat, May 12, 8:42am) |
| 3. |
PercentToWords (FIELD) |
| |
(Thu, May 10, 3:16pm) |
| 4. |
PercentToText (FIELD) |
| |
(Thu, May 10, 2:37pm) |
| 5. |
StripReserved( text ) |
| |
(Wed, May 02, 6:05pm) |
| 6. |
ListBaseTables |
| |
(Wed, May 02, 3:48pm) |
| 7. |
ValidEmail( theEmail ) |
| |
(Wed, May 02, 7:27am) |
| 8. |
UltraDate (Text; LongDate_or_DateDigit) |
| |
(Wed, May 02, 6:07am) |
 |
|
Thank you SO much.
Eric Ruff, Gainesville
July 04, 2010 6:53pm