AnsweredAssumed Answered

Prevent change to certain fields on layout

Question asked by ndveitch on Mar 14, 2016

Hi There,


I have a layout based off table JobTable that has fields from 3 different related tables on it, HeaderTable, BodyTable, and SignOffTable. The Header and SignOff are on the layout and the BodyTable is in a portal. I need to prevent changes to the layout once the related record in the SignOffTable has been created.


I have a button covering all the SignOff fields on the layout and once pressed will set SignOff::SignCheckMark to 1. Then when the script commits, there is a script on the layout that is triggered onRecordCommit to check if the SignCheckMark field is set or not. If SignCheckMark is set to 1, then it sets it to "Yes", Go to Field() and halts script. If it is blank, then the script halts. If SignCheckMark is set to "Yes" then revert any changes on the layout.


Now the issue is, there are a number of fields from the SignOffTable that need to be completed at the end of the job, but no other data on the layout can change once the supervisor has set the check mark. I was going to attach the "Prevent Change" script to all 40 fields on the layout that can't be modified, but I was hoping that there was a way to rather attach the script to the layout and not each field.


I tried the Get(ActiveFieldTableName) function but that didn't work as I hoped it would. I see that there is a function Get(ModifiedFields) and wondered if FileMaker are going to do a Get(ModifiedTable) version of it. Then maybe I could use an If statement to say If( Get(ModTable) = SignOffTable ; then halt script ; else revert record).