Filemaker - Portal table - Allow add, delete but not to edit

We havea  portal that shows a number of rows, and an empty row at the bottom that allows a new entry.

We also have a button setup to delete entries.

This is all fine; however once they add an entry, they are not allowed to edit it.

We have an issue in that a drop down appears for new entries (correctly) to pick from a value list.
Then once added, you can still pick this field and change it (incorrect).

The table has a linked subtable holds sub information that is only relevant to that entry (hence why we do not want this changed)

How can we solve this data entry issue?
webforcesukAsked:
Who is Participating?
 
Will LovingConnect With a Mentor PresidentCommented:
The script should probably be:

If [ not is empty( SomeTable::SomeField ) ]
    Go to Field [ Some other field ]
Else
    Go to Field [ SomeTable::SomeField ]
End If

I've attached a file that shows two portals. One setup the way you are currently doing things and one with a "New Record" button instead to create the new portal record. Note that the portal is sorted in such a way to ensure that the new record pops to the top. There are lots of other ways to do this and various coding efficiencies that can be incorporated, but this is the simple way: save the parent ID, go to a layout based on the related table, create a new record, Set the parent ID, go back to the original layout.

I've also incorporated two script triggers.

(On a separate note: while you can list any range of points for answering a question, in practice, virtually all questions are listed at 500 points.)
Add-New-Record-Basic.fp7
0
 
Will LovingPresidentCommented:
There are a couple of ways to handled this. Given your current structure, you could make the entry field a button that runs a simple script. The script would be an If statement which simply tests whether the field has a value in it. If not, you can use a Go To Field or Commit Records step to take the focus away from the field. You can include a Beep or dialog if you wish saying it's not editable.

If [ not is empty( SomeTable::SomeField ) ]
    Go to Field [ Some other field ]
    Beep
End If

Something else to consider though is scripting the entire new portal entry process. This allows you to simply turn off browse access to the field entirely and to have greater control over the process of adding new entries. It also have the beneficial design effects of 1) no longer needing users to scroll to the end of the portal list to create a new record, and 2) keeping users from accidentally creating new records they don't and then forgetting to delete them (a common problem when allowing users to create new records via portal entry)
0
 
webforcesukAuthor Commented:
OK, thanks.

For a few extra points, how would you go about doign this "add" via a button that sits ourside the portal within the parent tables layout?
0
 
webforcesukAuthor Commented:
PS: The first otpion works but not quite.  It certainly stops any input on fields already having a value in the field.  However my value list drop down no longer works for the new field entry.  Just remains blank.  Any thoughts?
0
 
webforcesukAuthor Commented:
Hi Will,

I will need a couple of days to look at this, but at present, I would suggest it exactly what I needed.

Once checked, Ill close the case and get you your points.

Thanks so far.

Martin
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.