1 Reply Latest reply on Jun 1, 2009 5:38 PM by comment_1

    script to perform find in one layout with a value from another

    annacaltech

      Title

      script to perform find in one layout with a value from another

      Post

      Hi,

       

      I have two layouts (showing data from two different tables), they are connected by a field called connection_ID. "Table 2" has several records for every connection_ID value in "table 1". 

       

      How can I create a script that, when you start in "layout 1", goes to "layout 2" and finds all the records that has the connection_ID value that the record in "layout 1" I just looked at?

       

      I almost get it to work (I think). I have a script that goes to "layout 2" and enters find mode. But when it should fill out the field (by using Set field) it says not a valued data entry... It seems that it does not like when I choose the Calculated results to be the value of the connection_ID field in "layout 1"... what am I doing wrong?

       

      Thanks,

      anna

        • 1. Re: script to perform find in one layout with a value from another
          comment_1
            

          Actually, you don't need to do a find at all for this - the  Go to Related Record [] script step will do this for you, if you select the 'Show only related records' option.

           

           

          To answer your question: when you enter Find mode, fields have no values (except global fields). In addition, when you move to the other table, you may arrive at an unrelated record. So to do it that way, you need to take the parent's id value with you, e.g.:

           

          Set Variable [ $parentID ;  Table 1::connection_ID ]

          Go to Layout [ Table 2 }

          Enter Find Mode []

          Set Field [  Table 2::connection_ID ; $parentID ]

          ...