4 Replies Latest reply on Jun 28, 2013 12:01 PM by deathrobot

    Strange variable behavior



      Strange variable behavior


           I'm running a script that sets a variable to the primary key in a parent table, goes to a child table, and sets the foreign keys on a found set of records to the variable. When I was creating the script, I had included a script step that brought up a custom dialog showing the variable, like so:

           Perform Find [Restore] // finds the flagged records in the ChildTable
           Go to Layout ["ParentTable Layout" (ParentTable)]
           New Record/Request
           Set Variable [$variable; Value:ParentTable::primaryKey]
      Show Custom Dialog [$variable]
           Go to Layout ["ChildTable Layout" (ChildTable)]
           Replace Field Contents [No dialog; ChildTable::foreignKey; $variable]

           Everything works correctly. However, when I disable the "Show Custom Dialog [$variable]" script step, the script no longer works. It replaces the child table's foreign key with a value that does not match the parent primary key. I'm using UUID's as keys, not serial numbers, so it's not obvious where it's getting this incorrect value from. What is that dialog script step doing? I'd really like to get rid of it.