hassam36 Posted November 19, 2008 Posted November 19, 2008 Hello If I am on a layout with portals and need to create a new record in the portal through scripting (and the portal has required fields in it), is there any way I can create it without committing the new portal record and not get any errors for not completing the required fields? Joe
mr_vodka Posted November 19, 2008 Posted November 19, 2008 You can have the user enter dat into global fields and have your script create the related record for you.
hassam36 Posted November 19, 2008 Author Posted November 19, 2008 I'd rather have them enter directly into the fields unfortunetely
mr_vodka Posted November 19, 2008 Posted November 19, 2008 You can enter data into a portal row and if you dont want it to commit, you can revert the record. As for your required fields, I am not sure what validation has to do with your reverting the record.
Vaughan Posted November 19, 2008 Posted November 19, 2008 Create the new portal record in a new window.
hassam36 Posted November 20, 2008 Author Posted November 20, 2008 (edited) The problem is that I want to create the portal record through a script and pre-populate certain fields, then have the user enter the remaining fields in the record. When I go to create the portal record through the script (by opening a new window and going to the portal table in the new window to create the record), the script will not close the window or exit the record without committing the record. So I can't get back my layout with the portal record for the user to enter the remaining data. Edited November 20, 2008 by Guest
hassam36 Posted November 20, 2008 Author Posted November 20, 2008 I am doing that actually. The script will not close the new window or exit the record without committing it.
IdealData Posted November 20, 2008 Posted November 20, 2008 You can still address the related fields in your script. The fields that need to auto fill do not need to be on the layout. Why not have these field do an auto-enter?
hassam36 Posted November 20, 2008 Author Posted November 20, 2008 Some of them are auto-entered. The problem is that when I try to leave the window with the portal table in it, I cannot because there are required fields in it that I cannot populate through the script. The user must enter these when the script is complete.
David Jondreau Posted November 20, 2008 Posted November 20, 2008 1) In the script, do you have the script step, Set Error Capture[On]? 2) Change the validation. You don't say what the validations are so suggestions are tough, but using Get(RecordModificationCount), or a variable set by script can work around this.
hassam36 Posted November 20, 2008 Author Posted November 20, 2008 I just tried set error capture on, but that did not work either. Its not really validations, but required fields that are preventing me from leaving the window I am using to create the new portal record and returning to the layout.
mr_vodka Posted November 20, 2008 Posted November 20, 2008 Its not really validations, but required fields that are preventing me from leaving the window I am using to create the new portal record and returning to the layout. Isnt that a form of validation?
hassam36 Posted November 20, 2008 Author Posted November 20, 2008 Yes. They are just required fields though. I would rather not unrequire them and validate the presence of data through a script.
mr_vodka Posted November 20, 2008 Posted November 20, 2008 I dont follow your process. Why dont you create allow creation of record through your portal to create the record? You can set the data that you want using set field. Then the users can enter in the rest of the data.
hassam36 Posted November 20, 2008 Author Posted November 20, 2008 I can't do that. The layout contains budget information. At certain times, I am "locking" the layout from editing with a script. However, the locking script does not prevent users from inserting new records. So, I removed the ability for users to create records on the layout and added a "create record" button that when pressed checks if the budget is locked. If not, the script opens a new window to create a portal record and returns to the layout for the user to enter data
mr_vodka Posted November 20, 2008 Posted November 20, 2008 You can make each enterable field in the portal row check to see if you have it "locked". If locked then show custom dialog. If not then go to the field. I am assuming that you dont mean FileMaker's record locking here but rather a lock feature you have incorporated...
hassam36 Posted November 21, 2008 Author Posted November 21, 2008 What you are describing is what I am doing to prevent the editing of existing records. However, this process will not prevent a user from creating a new record.. Thus requiring the need to create new records through the pop-up window and my current dilemma. The worst case scenario is that I commit the records upon creation through the script and hope users complete the data entry.
David Jondreau Posted November 21, 2008 Posted November 21, 2008 (edited) I fear we're talking too much in generalities here. How many fields in a related record require validation? What is the validation (not empty, unique, etc)? What does the base table represent? The portal? Rather than us saying, "Try this" and you saying, "I did", tell us what's going on. Without that I can suggest (again) using Get(RecordModificationCount) for validation in an auto-enter calc. Edited November 21, 2008 by Guest
hassam36 Posted November 24, 2008 Author Posted November 24, 2008 The fields are just required, no other validations. But someone here may have found something that will help: adding global fields to the portal tab. The users can enter the data in the globabls and click a button. Upon clicking, if the budget is not locked and all data has been properly entered, the globals can be copied to the real portal fields.
Recommended Posts
This topic is 5844 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