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.

Conditional formatting for a filtered portal (count records)

Featured Replies

Hello forum!  I have an issue I'm trying to solve.  I know why it doesn't work, I just don't understand how to make it work.

I have a button, 'Show All', which basically performs a show all records.  I want to hide/show this button (FM ADV12) on a layout depending on the obvious condition-hide when all records showing, show when not all records showing. 

The layout is based on products with a self join portal (Products_Self).  The portal is filtered for basic type ahead.  When I type into the search box, the portal filters. 

As the portal records are filtered, I want the 'Show All' button to appear. 

The expression being used for conditional formatting is:

  Get ( FoundCount )= Get ( TotalRecordCount )

which I know wont work because filtering the portal doesn't change the found count of the main layout.

Things I tried:

I researched quite heavily and found things that almost apply, but don't seem to work (or I cant get them to work :) ).  One idea was to create a summary field, to count ID's of the portal.  Create a one row/one field portal with the same filter.  This part works, I get the number of portal records, but any attempt to use that in the conditional formatting has failed...ie  things like  sCount <> Get(TotalRecordCount)

Anyways, I'm sure I'm dancing right around the answer but have had no luck.

I've attached a stripped-down version of the file...U/N Admin, no PW, with notes.

If anyone has any thoughts/comments/help, I'd greatly appreciate it.

Thanks

Steve

MFOinvoiceSample.zip

32 minutes ago, Steve Martino said:

I'm sure I'm dancing right around the answer

I believe so. Se if the attached helps.

FilteredPortalCount.fp7

  • Author

Thanks Comment, I found one of your sample files when I researched.  It gave me the ideas to get me to where I am at now.  I do get the correct portal record count, I just cant figure out how to put that into the conditional formatting for the text on the button.

For example, in your example, if I put a text field (button) on the layout, and use the conditional formatting expression:

Items::sCount = AllItems::sCount, and set the text for red. 

I was hoping that when I applied a filter, and now Items::sCount does not equal  AllItems::sCount the text color would be black, and when I cleared a filter, the text color would turn red.  But obviously that's the wrong expression.

Thanks again for helping

Steve

Doink....put the portal filter expression in the conditionally formatting expression...Now it works!  Thanks!

Edited by Steve Martino
additional info

8 minutes ago, Steve Martino said:

Doink....put the portal filter expression in the conditionally formatting expression...

No, the trick is to give an object name to the summary field placed in the filtered portal, then use the GetLayoutObjectAttribute() function to get its value.

  • Author

Well that is some trick, and much easier.  I would never even imagine what GetLayoutObjectAttribute() was for or how to use it.

Have you ever been stumped?

Thanks again

Steve

P.S.  For others following, named the summary field 'Counter' and the expression that works is:

GetLayoutObjectAttribute ("Counter" ; "content" )= Get(TotalRecordCount)...if I now have it right :)

Edited by Steve Martino
additional info

4 minutes ago, Steve Martino said:

Have you ever been stumped?

Every day. :)

Hi Steve,

25 minutes ago, Steve Martino said:

Have you ever been stumped?

EXCELLENT QUESTION.

2 minutes ago, comment said:

Every day

NOT HARDLY.

Okay, maybe temporarily while you are trying to decipher a poorly written question, but even that doesn’t stops you most of the time.

 

Yes, hard to believe Comment is stumped, isn't it, Lee?

Well, the best riders are those that have been bucked off the most and gotten back on.  I suspect that the best developers are those that have been stumped the most but climbed back in the saddle more than anyone else.  :-)

And there are two kinds of sailors. Those that have run aground and liars.

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.