pjdodd Posted July 11, 2006 Posted July 11, 2006 Hello My (grossly simplified) situation is this: I have two tables called Apples and Oranges. They are linked properly using one field. Apples is the main table with records from Oranges displayed in a portal. Apples can be locked to prevent editing or deletion via scripting and the access in the Accounts & Priviledges setup. When this occurs, there is a script that also enables the Oranges records in the portal that prevents them from being edited or deleted. So far so good. My problem is this: Creation of the records in Oranges occurs from the portal on the Apples layout. Once the Apples record has been locked from editing (and at the same time the current Oranges records as displayed in the portal), how do I prevent creation of further records in Oranges? I hope this makes sense to someone.
Tim W Posted July 11, 2006 Posted July 11, 2006 How are records created in oranges, by direct entry with allow creation of records checked in relationship setup or by a script that creates and attaches the the child record to the portal view? If 1st method is used your goal will be most difficult to achieve. IMHO the 2nd method is better because it offers more control of the record creation process and would require only a few script steps in the new record script to accomplish your goal. To do this simply make the new record step a condition of a true if statement as follows. If (isempty(Apple:RecLocked)) New Record/Request Setfield (orange:foreignkey ; Apple:Key) else Message "Apple record is locked, cannot create orange" endif HTH Tim
Recommended Posts
This topic is 6710 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