3 Replies Latest reply on Apr 26, 2014 7:57 AM by philmodjunk

    Basic Set Field Question

    dinoapolito

      Title

      Basic Set Field Question

      Post

           Sorry if this is a question I should know the answer to...

           Layout 1 is based on Table 1 and is related to Layout 2 which is based on Table  2.

           There is a script trigger on Layout 1 - OnRecordLoad - which I want to use to update field on Table 2 with a Set Field script  step. Basically the idea is that when II move from record to record on Layout1 the script updates Table 2.

           My question is, do I need to Go to Layout 2before the Set Field script step?  Set Field seems to only work if my script goes to Layout 2 first.

           Does that sound right? I don''t want to leave Layout 1 to update Table 2

           Thanks

           dino

        • 1. Re: Basic Set Field Question
          SteveMartino

               You could open a second window, change it to the right table, set the field, close the window.

          • 2. Re: Basic Set Field Question
            dinoapolito
                 Yes, and I have done that but it looks messy. Imagine advancing through several records in the first window and having that second window blink open and shut each time. Very ugly.
                  
                 Unless there's a better way I'll do it from the one window, freezing the script, changing layout then coming back again to the original layout.
            • 3. Re: Basic Set Field Question
              philmodjunk

                   But what is the relationship between table 1 and table 2? one to one? one to many? or ???

                   If it's one to one, why do you need two tables?

                   If it's not one to one, there are problems with what you want to do here as there could be many records in table 2 related to one record in table 1.

                   A many to one relationship, on the other hand, may make sense, but it's also possible that you can get the results that you want without using any script at all. It depends on what you are trying to do.