AnsweredAssumed Answered

Having trouble with Add New Record Script

Question asked by john.s on Dec 27, 2013
Latest reply on Dec 27, 2013 by philmodjunk


Having trouble with Add New Record Script


     I'm trying to have a way for users to add a new record without giving access to any other records.  I have a button on the users main screen that runs this script.


Script - Add New Senior Record


Set Error Capture [On]

New Window [Name: “Add New Senior”; Height: 565; Width: 625; Top: 50; Left: 50; Style: Dialog]

Go to Layout [“Add New Senior Record” (Seniors)]

Show/Hide Toolbars [Hide]

New Record/Request

Commit Records/Requests [No dialog]

Go to Field [Seniors::_fk_SchoolCode]


     After they input the data they click either the "Add Record" Button and the following script runs 


Script:  Commit Record and Close Window


Commit Records/Requests [No dialog]

Close Window [Current Window]



     OR  they press the  "Cancel DO NOT ADD RECORD"  button and the following script runs


Script:  Cancel New Record


Delete Record/Request [No dialog]

Close Window [Current Window]


     This works ok until someone (like me) opens the layout and presses the "Cancel DO NOT ADD RECORD" at which time a valid record is deleted from the database.


     Is there an easy way to know if a new record was in fact created before deleting so I don't inadvertently delete records from the database?  Or is there a better way to do this altogether?