2 Replies Latest reply on Jan 30, 2014 4:45 PM by bdexter75

    Script to pass a value from layout to layout

    bdexter75

      Title

      Script to pass a value from layout to layout

      Post

           Hi All,

           I’ve been attempting to write a script for the last three hours and am getting nowhere.  There is something fundamentally missing in my understanding of scripts and functions.  The script is supposed get the contents of a field on the current layout (Layout A) then go to another layout (Layout B), populate a field on B and perform a find.  So this is what I did:

           Go to field (in Layout A)

           Get (currentfieldcontents)

           Go to Layout B

           Go to field

           Set field (put the value here)

           Commit record

           Perform find

           This script is activated by a button on Layout A, but all it does is get me to the field on Layout B and stop. It fails to pass the value from the field in Layout A.  What am I doing wrong?

        • 1. Re: Script to pass a value from layout to layout
          philmodjunk

               I am unsure as to what you are actually trying to do here, but will guess that the data from layout A is to be used as search criteria on layout B.

               Set Variable [$Variable ; Value: LayoutATable::YourField ]
               Go to Layout ["Layout B" (LayoutBTable) ]
               Enter Find mode [] ----> clear the pause check box
               Set Field [LayoutBTable::YourField ; $Variable ]
               Set Error Capture [on]
               Perform Find []

               For more on scripted finds, see: Scripted Find Examples

               When Setting up Set Field, there are two Specify buttons that must be clicked. To get Set Field [Table::Field ; Expression], add set field to your script and click the first button (specify target field). Select Table::Field from the list of fields. Do not click the specify button next to the repetition box. Click OK to close this dialog box. Now click the lower specify button (calculated result) and create the expression to the right of the semicolon (;). Do not try to type in the semicolon.

          • 2. Re: Script to pass a value from layout to layout
            bdexter75

                 That's awesome PhilModJunnk.  Thanks.  It worked perfectly.  I would have never figured that out on my own.  What this actually does is grab the territory ID number from a record layout and takes me to a subsummary report to show me all the potential clients for that given sales territory.