Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 5844 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

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

Posted

You can have the user enter dat into global fields and have your script create the related record for you.

Posted

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.

Posted (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 by Guest
Posted

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?

Posted

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.

Posted

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.

Posted

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.

Posted

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?

Posted

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.

Posted

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

Posted

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...

Posted

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.

Posted (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 by Guest
Posted

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.

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.