1 Reply Latest reply on Mar 29, 2011 10:20 AM by philmodjunk

    Add Record via Window

    mikes

      Title

      Add Record via Window

      Post

      I have 4 fields in Table 2, 3 of which are used as lookup values in Table 1.  When the user is on the layout for Table 1 and enters a name in the field used as the key between the two tables, what is supposed to happen is the other 3 fields fill in automatically as a result of the lookup.  However, if there is no matching key in Table 2, is there a way to display a window that informs the user that the information does not exist in Table 2 and give them an opportunity to enter a new record and fill in the remaining 3 fields in Table 2 via a popup window while still on the layout for Table 1?  

        • 1. Re: Add Record via Window
          philmodjunk

          Yes. Use an ONObjectExit script to check for a related record when the user exits the name field. The script can then open a new window with the new window command and use Go To layout to select a layout to the look up table, then use new record to create a new record for the user to complete. A button to close the pop up window can use this code to enter the name from table 2 into the current record of Table 1 displayed in the original window:

          Set Variable [$Name ; value: Table2::Name]
          Close Window
          Set Field [Table1::Name ; $Name]