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

portal.FirstVisibleRow ( _portalName )

Rate this function:  

RatingRatingRatingRatingRating
  Average rating: 4.5  (32 votes)
  Discuss this Custom Function

Arnold Kegebein, Arnold Kegebein
http://www.kegebein.net

Get index of first visible row in a portal

Sample Input:
portal.FirstVisibleRow ( "portal.sample" )
Sample Output:
6


 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:

Calculates the index of the first visible row in a portal.
The parameter _portal is the object name of the portal.

Besides the object name for the portal, at least one object in the portal has to have an object name, too.

If the portal object name is unknown, nothing is returned.
If no object inside the portal has an object name, a question mark (?) is returned.

I was inspired by Fabrice Nordmann's function VisiblePortalRows. My cf returns only the index of the first visible row. Advantage: It does not use recursion (faster) and requires only one function parameter.

See also my function portal.rowCount to get the number of visible portal rows.

––––––––––
Instructions how to use this function:
(1) Create a portal.
(2) Give the portal an object name, e. g. "myPortal"
(3) Place an object into the portal, preferably a field from the portal table.
(4) Give this object an object name, e. g. "myField"
(5) Change to browse mode.
(6) Call the function (via data viewer or script or button): portal.FirstVisibleRow( "myPortal" )
(7) Scroll to a different row in the portal and call the function again.
(A) If the function returns 1, the very first portal row is visible. The return value 5 means, the portal is scrolled so far down, that the first four portal rows are not visible anymore.
(B) To verify the correct return value, add a label with the text "@@" to the portal. This will print the actual index of each portal row. The first index you can see in your portal should be the same value the function returns.

You may download a sample file with two portals at http://www.kegebein.net/download/PortalFirstVisibleRow.fp7.zip.

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

This functions doesn't work with multiple portals in the same layout, just the first one is working.

Arnold, you have any idea why?

Caps, Lisbon
January 12, 2012 3:27am

@Caps, sorry for your problems with this function. I tried it with two portals in the same layout without any problems.

Remember, each portal requires an object name (used as the function parameter) AND an object inside each portal requires an object name as well!

You may download a sample file (with two portals in the same layout) here: http://www.kegebein.net/download/PortalFirstVisibleRow.fp7.zip

Arnold Kegebein, Hamburg, Germany
January 12, 2012 7:57am

Sorry, Arnold.

I found the problem, It was my mistake.
I was trying to create a multiportal with sort buttons, using hidden tab controls, to perform the sort.
So in other to work, the script should go first to the object (Hidden TAB), then to portal, and after doing this perform you lovely custom function.

Thanks for sharing it, and explain all at
http://www.kegebein.net/blog/2010/08/dynamic-portal-scroll-bar/

Caps, Lisbon
January 13, 2012 6:42am

I really want to use this function but it looks as if this no longer works in FileMaker Pro 12 :( Any ideas for a workaround or hopes of a new version that works? The function works for the first 2 portal rows but after that ? is returned and some of the variables fail to evaluate within the function, I can only assume due to different way portals work in 12.

If you have another way to obtain the first visible portal row index I'd love to hear it, thanks!

Daniel Wood, New Zealand
September 18, 2012 3:32am

@Daniel Wood,
Thank you for pointing out the problem with this function in FM12. Somehow FileMaker changed the behavior of the function GetLayoutObjectAttribut. I am not sure if this is a bug or an intended behavior.

Nevertheless I created a version of this cf that will work with FM12. I posted it here BrianDunning under the name PortalFirstVisibleRow. It should be accessible soon.

Arnold Kegebein, Hamburg, Germany
September 19, 2012 2:19am

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 1 + 7 =
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