Return the portal row number of a matching key in a self join relationship
Sample Input:
Get_Row_Number ( ItemsSJ::PrimaryID , PrimaryID )
Sample Output:
3
Description:
When using this function with a self join relationship, it will return the number of the first row in that relationship that matches the key you're searching for.
I use it when I need to determine, from the context of a child table, what portal row that child record is seen as from the context of its parent. I want to know that the child Invoice Line Item record is portal row 3 in the parent Invoice record, for example.
To work properly for this purpose, set up a new Table Occurence and create a relationship between it and your original table. For matching keys, use your parent ID foriegn key. The relationship should now show, from the context of the child table, all child records tied to that child record's parent invoice.
There's probably a more elegant way to do this. I'm just counting the paragraph marks in a returned List() left of the matching key, and adding 1.
Note: these functions are not guaranteed
or supported by BrianDunning.com. Please contact the individual
developer with any questions or problems.
Instant Messaging for your FileMaker Pro network. Click
here.
Custom Function Authors:
Link to all of your own custom functions on this site with the following URL:
http://www.briandunning.com/filemaker-custom-functions/results.php?author=Your
Name Here