Jump to content
Salesforce and other SMB Solutions are coming soon. ×

Hide portal field if all of them empty?


hollsten
 Share

Recommended Posts

Hello. I have a portal (in an invoice Layout) consisting of several fields. Amount of portal rows vary from record(invoice) to record. Some fields should be shown on report/ printed only if some of the portal rows has any value in that field. i.e. the field is a discount field and if there is no discount on ANY of the portal rows then these fields shouldn’t be printed at all and the fields to the left of this discount field should move right (and also the labels that is outside the portal). There are two of these fields (discount amount in € and discount amount in %).

When I try “Hide object when” and use IsEmpty… then the field and label are hidden all right but the fields to the left aren’t moved to the right even when they are anchored to right. Also, the “IsEmpty” checks only first portal row. If Discount % field is empty at first row but not on some other row the label is hidden when it shouldn’t be. I guess I should loop the check for empty in some way?

I’m sorry, my English is not my native language so maybe I explained poorly and complicated. Please ask if I didn’t make sense.

(Filemaker 16 Pro Advanced on Mac)

Greetings from Finland, Jari

  • Like 1
Link to comment
Share on other sites

A little hard to understand, but if I understand you correctly, objects won't slide to the right, only up or left, and only in preview mode.  

If you need the field to 'slide' to the right, create two instances of the field, one that hides based on your criteria, and one that hides based on the opposite criteria, and put those fields where you want them to appear when not hidden.

Another way, if this is on a printed layout may be to use merge fields, with right anchors.  Then hidden fields won't show, and hopefully the ones showing will end up in the right spot.  I haven't tested that to be sure.

If that doesn't help, maybe a small demo file.

Link to comment
Share on other sites

Thanks a lot for taking the time to answer. If I try and start from beginning, how would I check if all fields of a particular name are empty in the portal? No matter how many rows? Is it even possible?

Link to comment
Share on other sites

Thanks. I made it like this: a summary field for these portal fields to check if they are empty and then if this summary field are empty then hide etc.

Now if I could understand why a field don't move right (when anchored to right) if the field to the right are hidden. i.e. Field A is anchored to right. Field B to the right of field A is hidden but still field A don't move right? Maybe like this by design?

Link to comment
Share on other sites

5 hours ago, hollsten said:

Now if I could understand why a field don't move right (when anchored to right) if the field to the right are hidden. i.e. Field A is anchored to right. Field B to the right of field A is hidden but still field A don't move right? Maybe like this by design?

Anchoring behaviour respects all objects, even those that are hidden. 

One solution would be to use two single panel slide objects – one for each case – when there is a discount and when there is not. Set the object visibility for each such that one or the other is visible at any time. Lay them on top of each other. Et voila!

  • Like 1
  • Thanks 2
Link to comment
Share on other sites

I'm a novice FM user and this would be my first post, so excuse me if I have the wrong thread on the issue here. I don't have recording software so I held my phone up to the screen to demonstrate what I've done.

David Head's approach is probably better/same as mine but nice to know that my effort isn't completely mad.

The portal fields are covered by a rectangle which is hidden according to the count of related documents.

So, you'll see no fields apart from one for a "comment" entry which exposes the remainder after entry. The rectangle covers the empty portal when I select the record with 1 document, then when I choose the record with 2 documents the empty portal display is covered by the rectangle with a different field(s).

This was easy to setup and maybe help out with your problem - I dunno, but nice to get something up into the forum.

Jim

Edited by Ross MacLane
Upload Filetype Not Accepted
Link to comment
Share on other sites

 Share



×
×
  • Create New...

Important Information

Terms of Use