john9210 Posted September 4, 2011 Posted September 4, 2011 FM 11 Adv. I don't understand when the Commit records script step should be used. Can anyone explain this?
Vaughan Posted September 5, 2011 Posted September 5, 2011 Whenever a record is being edited, FileMaker locks it so that no other users can change it at the same time. The commit steps tells FMP to check that the edits are valid (based on the field-level validation rules that have been defined) then save the changes and un-locks the record so somebody else can have a turn. So basically, in every script you should explicitly commit the record when finished editing the record. There are some steps that implicitly commit the record -- changing to another record and changing layout are two -- but it's good habit to do so yourself. You should also trap for commit errors. Records won't commit if the validation fails: say if it's a duplicate value (or empty) in a field that has been defined to be unique (or not empty). Record commit is important even if the solution in not intended to be used with multiple users: a record lock can occur when multiple windows are showing the same record and the record is being edited in one of them. (This caught a lot of developers when FMP 7 first released, it was the first version that allowed multiple windows of the same table to be open.) BTW also read up on the Open Record script step, it's used to work out whether a record is locked.
bcooney Posted September 5, 2011 Posted September 5, 2011 You're in luck! Todd Geist has released an in-depth video devoted to this topic.
Recommended Posts
This topic is 4828 days old. Please don't post here. Open a new topic instead.
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 accountSign in
Already have an account? Sign in here.
Sign In Now