February 8, 200719 yr I'm trying to create what I thought would be a pretty simple script. It's just a button that when you click will create a new record in a related table and fill in the related field's value. The tables are in 2 different FM files and the related data from the table I'm trying to create a new record in is displayed in a portal on the page I'm putting the button. So the script the button is attached to is: Set Variable[$$Control_Number; Value:Purchase OrderItems::Control_Number] Perform Script["Create New Scan Record" from file: "Purchase Order Items"] Go to Layout [original layout] The Create new Scan Record script in the Purchase Order Items file where the related table is stored looks like this: Go to Layout ["Scans-Data Entry"(Scans)] New Record/Request Set Field [scans::Control #; $$Control_Number] Commit Records/Requests[No dialog] So the idea is that when you click the button from the original location it will store the control number in a variable and pass it to the script in the other file. Then create a new scan record, populate the control number field in that record with the value in the variable, commit that record. Then you'd end up right back where you were with a new record created in the portal that you can now add data to the other fields. The problem is the $$Control_Number value is not carrying through to the Create New Scan Record script in the other file. I tested this by adding a Show Custom Dialog step into each of the scripts. On the first script it displays the value in the variable just fine. In the other script the dialog comes up blank. I thought that $$ variables were global? Any information on why this value isn't passing for me would be greatly appreciated. Thanks!
February 8, 200719 yr The scope of local and global variables is limited to the current file. Why dont you pass the value as a script parameter instead. Then you can pass the SP to the the external and subscripts as well.
Create an account or sign in to comment