Portal Delete Buttons

When a relationship allows the creation of related records, you simply enter a portal row and start to enter new data. The problem, from an interface standpoint, is when you start to add buttons to you portal rows.

One button in particular, can give you a bit of a hassle with this default behavior of creating related records. It's the delete button that rears its ugly head when your last row reveals the button, yet the row is waiting for new data. You can't delete a related record when it doesn't exist - although that is exactly what FileMaker lets you do!

The solution to this problem is to simply determine if the portal row is showing a record or showing nothing. By making this determination, you can show a button appropriate to the action which a user might expect.

This video provides you with core technique that will add a bit more polish to your solutions!

AttachmentSize
PortalDeleteButtons.zip117.47 KB

Comments

Another very useful technique, well explained. Just a question about naming conventions. In calculations, you prefix variable names with an underscore. Is this to distinguish them from script variables? Do you have any recommendations or cautionary tales?

My use of the underscore in calculation variables is simply to avoid field name collisions. In other words _CustomerName will not match CustomerName when I have a field named as such.

Since you never start a field name with an underscore you always have peace of mind about the subject.

My personal conventions don't always match those of others, but you can find some good information in the FileMaker white paper about the subject.

Look for the document named FileMaker Development Conventions.

-- Matt Petrowsky - ISO FileMaker Magazine Editor

I am a novice for FMP, and wanna learn some skills about Filemaker.