Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.
Juggernaut

List() alternative in 8?

Featured Replies

Designed a database for 8.5, now I find out it's going to be used in 8. I have a calculation field that determines an overall status of these related records by using List() function (depressingly native to only 8.5). Any ideas how to revamp this field definition?

Field Definition:

Let( [ $BinStatusList = List( OrBin_OrderNumber::Status_Bin ) ];

Case(

IsEmpty( $BinStatusList ) or PatternCount( $BinStatusList; "Needs Duplication" ) = PatternCount( $BinStatusList; "¶" ) + 1; .........blablablablabla....restofcasefunction..........

)

)

There's not a way to have a Get( RelatedRecordCount ) or something, is there? With that I suppose I could make a custom function with a self-calling Get( PortalRowNumber ) if I knew how many portal rows there were.....

Then again, I love to complicate things. Gotta be a simpler way.

If you happen to have fm advanced lying around...

ListFieldContents( Field ; RelatedCountField ; result ; n )

Let( [

n = n + 1 ;

numRecords = Count(RelatedCountField) ;

result= If( n > 1 ; result & ¶ ) & GetNthRecord( Field ; n )

];

Case( n >= numRecords ; result ; ListFieldContents( Field ; RelatedCountField ; result ; n ))

)

Usage:

List( YourRelatedField ; YourRelatedPK ; "" ; "" )

Returns:

My

Name

Is

Earl

And

Isn't

Really

Alex

Next Record Is Empty

But The CF Doesn't Care

Cause It's Counting

A primary Key.

Edited by Guest
Changed "my" to "your"

  • Author

mr_vodka --- the "Portal Info in a List" downloaded an empty folder. but the other link you posted worked fine. that Comparison is a great example, thanks!

Genx --- I do happen to have a Developer copy sitting around so I ended up using ListFieldContents() function. thanks! that was a good quick fix.

Both downloads worked for me.

Lee

  • Author

Hm, weird. I've tried it on my G4 and on my Intel and I'm still just getting an empty folder. Odd...

Is there is setting that you have to change on your mac to display files with no application associated with them? You probably dont have FM6 and the files are .fp5 files. Once located, you can just convert them to .fp7 by dragging and dropping into the FM8.

Edited by Guest
TYPO

  • Author

Nope. Macs show all files regardless of whether you have an application associated with them. (I do have FM6 by the way.)

I ended up going to their website and navigating to see if I could find it. A couple other .zips did the same thing.... I've tried a few browsers, too; no avail. I'll try on another computer in my office tomorrow. Dunno!

  • 2 weeks later...
  • Newbies

I'm guessing that ListFieldContents is an FMP 8.5 Advanced function, because it doesn't exist in FMP 8.0 Advanced.

Or am I missing something here?

  • 2 weeks later...

What is "MyRelatedPK"?

  • 2 weeks later...

Hi Dave, your missing something :)

Its a custom function, i.e. one you create yourself using the advanced version of FM.

Go to File > Define > Custom Functions.

Create a New Function

Call the function:ListFieldContents

Add these 4 as the variables:

( Field ; RelatedCountField ; result ; n )

This is the main portion:

Let( [

n = n + 1 ;

numRecords = Count(RelatedCountField) ;

result= If( n > 1 ; result & ¶ ) & GetNthRecord( Field ; n )

];

Case( n >= numRecords ; result ; ListFieldContents( Field ; RelatedCountField ; result ; n ))

)

Just to clarify, it doesn't have to be a primary key (your related table might not have one) it just has to be a field in your related table that is never empty... primary keys just always exhibit that characterstic

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.