Jump to content
Server Maintenance This Week. ×

Conditional formatting for a filtered portal (count records)


This topic is 3065 days old. Please don't post here. Open a new topic instead.

Recommended Posts

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

Link to comment
Share on other sites

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
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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
Link to comment
Share on other sites

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.

 

  • Like 1
Link to comment
Share on other sites

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.  :-)

Link to comment
Share on other sites

This topic is 3065 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

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