July 11, 200322 yr Hi. How could I prevent users to create new records in a related file when the master record is locked? Example: An invoice locked on a record-by-record basis contains several items in a portal. The related records (details) are also locked by a calculation field related to the master record. The user can not modify the master record or the related records, but can create new related records, modifying in such way the master record. Thanks in advance for any help! [color:"black"] [color:"blue"]
July 12, 200322 yr Author Thanks for your answer cjaeger, could you be more explicit? I don't quite understand
July 12, 200322 yr What do you not understand? Do you know something about passwords and groups in FileMaker?
July 12, 200322 yr Author If I disable access to the related file, users will not be able to create new Invoice Details in new unlocked Invoices. Users should be able to create, modify and delete any Invoice or Invoice details until the master record and the related records are locked by a script. When those records are locked, users are not allowed to modify or delete them, but they could anyway create new records in the portal in the Invoice Layout. The question is: How to disable access to create new records in the portal when the Invoice is locked? I know something about passwords and groups. If you know the answer please help. Thanks.
July 19, 200322 yr Hi Ed, I think the best thing you can do is turning off the 'Allow creation of related records' function in the relation definition for the invoice details. You still can create new records in the details database via a script if you turn that option off. If the portal does not update after creating a new detail record via the script, try 'setting' the field on the left side of the relation to it's own value at the end of the script. Mybe an extra 'exit record' script step will do the trick as well... Hope this helps! Regards, Ernst.
July 19, 200322 yr Hi, You can still use a validate by calc on each field used in the portal with calculation Master:Locking key = yourvaluelock Also set it to be strict with message. Users would still be able to create a new entry, but they couldn't proceed filling new related record datas. You'd end up with a Unique_Id created in the related file, and the auto-filled Foreign Key. As nothing else in that portal would have been filled except the auto-entered ID, you could hunt this empty record. This could be done this way. Create a stored calc in the related file : HuntEmpty = Case(IsEmpty(SomeFieldInPortal), "empty" & Master_ID,"") This calculation would have its counterpart in the Master : MatchEmpty = "empty" & Master_ID Create a relationship HuntEmptiesRel = MatchEmpty::HuntEmpty Then include the following script to each other Navigation Script (go to next/previous/last/first record) : If IsValid(HuntEmptiesRel) Show Message ("There is an empty record in the related file, please delete it") Go to Related record (HuntEmptiesRel- show only) External script (delete) Refresh GoTo Next/Previous... Else Goto Next/Previous.... This is the method I use, and a quite similar method is used and discussed, as long with a sample (the second one) here. Disabling Allow Creation at the Fly (Try entering data in the "some text field" and check the script "New Line by script") Now, the easiest would be to have each field in the portal be a button with script If Locker = OK Go to field Else Show Message HTH
Create an account or sign in to comment