toshog Posted August 27, 2002 Posted August 27, 2002 hi all, i'm trying to set up a script that will create a new record in a data base that is related to the one that is performing the script and sets up the value of one of the fields of the newly created record to a randome number... the fields of the remote database are displayed in a portal in the database that will perform the script... how do i do that? thanks
CobaltSky Posted August 27, 2002 Posted August 27, 2002 Based on what you've said, one way to do what you want would be to: Create a script in the related file with the steps: Enter Browse Mode New Record/Request Set Field ["YourField", "Int(Random * NumericRange)"] Toggle Window [Hide] ...and then call that as an external subscript from within your main file. Depending on the set up of your relationship (ie whether 'Allow creation of related record' is enabled, you might alternatively consider setting the script in the main file to: Go to Portal Row [Last] Set Field ["RelatedFile::"YourField", "Int(Random * NumericRange)"] from within the script in the main file If you want your random number to be generated every time a new record is created - regardless of whether is is done with the script - you might prefer to place the formula which generates the random number in the Auto-enter by calculation options for the relevant field.
Recommended Posts
This topic is 8224 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