Jump to content

Hiding Empty Portal Rows (Preventing them to display)


Recommended Posts

If you need to have the option on in the relationships diagram: "Allow creation of records in this table via this relationship", you will always have an extra empty row at the bottom of your portals (see here).

But if you don't want the extra empty portal row to be displayed, there is a workaround:

You can conditionally hide all the fields in your portal, for example when the record is empty. In Layout mode, I enter into the box: "Hide Object, when" the following code:

isEmpty ( Relation_to_Table::id )

This is only cosmetic, but nevertheless, it works great: Now, only those portal rows appear that have values in it. You might need to adjust background colors, etc.

Hope this helps someone.

G.

Link to comment
Share on other sites

Another way is to have both a creation method as well as a presentation layer drawn in the realtions graph, where only the creation method allows entry in the last related record, due to the "allow creation ... " - the problem being littering the CSS with all kinds of nooks and crannies...

--sd 

Link to comment
Share on other sites

14 hours ago, gczychi said:

If you need to have the option on in the relationships diagram: "Allow creation of records in this table via this relationship",

14 hours ago, gczychi said:

You can conditionally hide all the fields in your portal

I see a contradiction here: 
Normally, you allow creation of records via a relationship so that users can add new records by entering data into the first empty portal row. If all the fields in that row are hidden, they won't be able to do that.

I hide only objects that would be a distraction to the user - for example, a delete button or a calculation field that would evaluate to 0. Here's an example I posted recently:

 

 

Link to comment
Share on other sites

It should also be noted that conditional formatting, calculated hides as well as portal filtering very often slows down the rendition of a record - due to excessive use of unstored calcs!

--sd

 

Edited by Søren Dyhr
Link to comment
Share on other sites

Quote

I see a contradiction here: 
Normally, you allow creation of records via a relationship so that users can add new records by entering data into the first empty portal row. If all the fields in that row are hidden, they won't be able to do that.

I hide only objects that would be a distraction to the user - for example, a delete button or a calculation field that would evaluate to 0.

There is only a contradiction if user needs to add new records into the portal. In this case, I only need the «Allow creation of records in this table via this relationship» for scripting purposes. It’s infinitely easier to add new records using the Set Field script step (from a related table) than using any other way to add new records from within a script.

G.

 

Link to comment
Share on other sites

21 minutes ago, gczychi said:

It’s infinitely easier to add new records using the Set Field script step (from a related table) than using any other way to add new records from within a script.

I see no difficulty in going to the related table and creating the records there. Sometimes it is easier to use a relationship, but the difference is minute, not "infinite". If there is a need to show a portal based on the same relationship, I would much rather add a few steps to the script than muck around hiding the objects in the portal. 

 

  • Plus1 1
Link to comment
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
×
×
  • Create New...

Important Information

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