Jump to content

Recommended Posts

Hi Everyone

Can someone tell me if this is possible? I have a dashboard which displays services due, services outstanding, completed services and faults outstanding. What I want to do is put a little "badge"  on the buttons displaying the amount of records showing in the portal related. I have no idea where to start. I have attached some images and also my relationship view.

Thanks in advanced!


Portal 2.JPG


Share this post

Link to post
Share on other sites
comment    1,392

You can merge a calculation field within the button text. Therefore the real question is whether a calculation field can determine the number of records shown in a portal. I suspect your portals are filtered, so it's difficult to answer without seeing the filtering expressions. If they're not, it's a simple matter of = Count ( PortalTO::MatchField ).



Edited by comment

Share this post

Link to post
Share on other sites

Hi thanks for the reply, where would I create this calculation field. My portals are filtered please see below

Service Info Portal::Service Complete = "Yes" and Month ( Service Info Portal::Next Service Date ) = Month ( Get (CurrentDate )) and Year ( Service Info Portal::Next Service Date ) = Year ( Get (CurrentDate ))

Share this post

Link to post
Share on other sites
comment    1,392

The calculation field would be in the dashboard table. However, such calculation field cannot duplicate your filtering expression.

How about a different strategy: define a summary field in the portal table as Count of [ primary key field ]. Merge this field in the button text, and place the entire button within a one-row portal to the same TO, filtered by the same expression. 

Note that a side effect of this is that the button will disappear if there are no records shown in the portal.



Edited by comment

Share this post

Link to post
Share on other sites


I have created a summary field in the services table as you have described, but your next instructions are not very clear to me.

I have done it!!! Well done!!! But now I have a white box where as what I wanted was it to blend into the button and I cant colour the portal feild to transparent


I've Done it...you are a genius!!! Thank you so much!!!!

Share this post

Link to post
Share on other sites
comment    1,392

Let me add a general note:

Portal filtering is slow - and will get progressively slower as the number of records to filter grows. It is much more efficient to filter the relationship itself. You may think it's not possible because it would require an unstored calculation to serve as the match field on the portal side. However, that is not true: you can define a stored calculation field in the Services table as =

Next Service Date - Day ( Next Service Date ) + 1

and use it as the match field opposite an unstored calculation field of =

Get (CurrentDate) - Day ( Get (CurrentDate) ) + 1

in the dashboard table, to make only records in the current month related.

  • Like 1

Share this post

Link to post
Share on other sites

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

  • Who Viewed the Topic

  • Similar Content

    • By Pyorkie
      Haven't been on for a while. I have a question. Does anyone know how to create mutually exclusive buttons? I have 2 buttons/fields that have 2 different value list attached. I would like to be able to click on one of the buttons/field and to have the other buttons/field become inactive and visa versa and to then reset to both active in the next record so that I can then choose again.
      If I click  buttons/field (1) I want  buttons/field (2) to be inactive and if I click  buttons/field (2) then  buttons/field (1) to be inactive but when I create a new record then both are available to choose again.
      Please forgive me but I am still learning , I am sure a script would be required but I don't have that type of expertise and I have exhausted all the help files and can't find what I am after.
      Any help would be much appreciated. This is a personal project (actually for my wife).
    • By MutantST
      Hi All,
      I would like to create a button that copies data from specific table and fields to other ones on display in my form. The context for this is that I am creating a button that copies data that has already been entered and displayed in some text merge fields. i.e., Account address (first table), and I would love to have that data copied to the location address fields (second table).
      See attached file.
      Any help would be gratefully received (Complete beginner).
      Cheers, Simon
      DB_SC_Grab- button question.tiff
    • By FrancoFranco
      Hi all,
      Apologies if this in the wrong place, but it seems like the best fit. Just wondering if anyone can help me out with a script I'm struggling with.
      The background: I have a button I'm using to launch a new window with another layout, then create a new, related record. This action will only happen if the user has completed a specific field in the original layout (__pkCollectionRef), step one of the script.
      With the new window open, the user will then make a selection from a checkbox set and close the window, which will put their selections into a field in the original layout.
      This part's all fine. What I want  then, however, is for the button to be made inactive once they've completed their selection, so the script won't run if they press it a second time (this is to prevent the creation of redundant records - there is another button that will allow them to edit their previous selections if required).
      I've attached two screen grabs of the script steps. The first is the script I require help with, the second is the script run if the necessary conditions of the first are met (i.e the creation of a related record in a new window and layout).
      The _fkPickList field in the original layout will only be populated upon the creation of the new related record, so I had thought that adding the isValid calculation as a means of halting the script would do the trick, however what's happening is that it's preventing the script from running in the first place.
      As a side note, I've also added conditional formatting to the button so that when the _fkPickList field isValid the text is greyed out. This one discourages pressing the button a second time, however, not prevent it from working.
      Thanks in advance for the help. All comments appreciated.

    • By mikedr
      I've gotten a lot out of this forum, so I try to pay it forward when I can, even though it'll likely only benefit newbies.

      I have an "image" button that is tied to a popover. So you click the button, and you get the popover. Easy enough. Usual UI interaction is that if you click the button, the popover appears, and if you click it again, the popover disappears. Again, all typical FM stuff.

      FM does not allow conditional formatting of image buttons to change the color. I wanted to emphasize to the user that for the layout field in question (in the popover), data has been entered. So I created another layout object -- an oval/circle surrounding the image button -- that is displayed only if one or more of the fields of the popover tied to the image button has been populated. Again, typical FM stuff.

      What was flummoxing me, though, was that the image button wasn't "working" as expected. If you clicked on the button, the popover appear. But if you clicked on it again, the popover would "re-appear," instead of disappearing.

      The problem it turns out was that my oval/circle surrounding object was "over" the image button and in the foreground. So FM didn't see a user was still hovering over the image button, but rather was hovering over the oval/circle object when it was shown. Thefore, if you clicked on the image button again, FM thought (correctly) that the image button was not previously being hovered over, and dutifully showed the popover again.

      Very, very easy fix -- in the layout edit mode, I simply moved the oval/circle object to be behind the image button. Everything now works as expected.

      I hope this tip helps someone! It took my around 90 minutes to figure out what was going on . . . . . .
    • By The Missing Man
      I have a listing in table view and want to have a button attached to the line items so I can go directly to a particular line item in a different layout. Is this possible?
      Thanks in advance

Important Information

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