3 Replies Latest reply on Sep 10, 2016 9:19 PM by executor

    Script problem with 1 table 2 layouts.

    executor

      Hello,

      I have DB with several tables. I have Layout named PowerMeters and layout named Phone (show records from Powermeters). And all fields added in Phone are actually part of the PowerMeters. I have layout named “Log”. And script that tracks changes in PowerMaters , make record in “Log”. Тhe script does not work when there is a change in fields in layout Phone. Script make record in Log ONLY when detect changes in Powermeters.

       

      Part of scritp:

       

      Set Variable  [$sbst; Value:PowerMeters::substations]

      Set Variable  [$prg; Value:PowerMeters::program]

      Set Variable  [$acode; Value:PowerMeters::areacode]  /this is from layout phone/

      Go to Layout [“Log” (log)]

      Ne Record/Request

      Set Field [Log::substationslog; $sub]

      Set Field [Log::programlog; prg]

      Set Field [Log::areacodelog; $acode]

      Go to Layout [original layout]

        • 1. Re: Script problem with 1 table 2 layouts.
          beverly

          can you show a screen shot (or two) of the layout mode for both that shows the context?

           

          It will show:

          Layout: (and the drop down with the layout name), a pencil/edit icon, Table: (and the name of the Table Occurrence on your relationship graph)

           

          Thank you,

          beverly

          • 2. Re: Script problem with 1 table 2 layouts.
            philmodjunk

            If Beverly hadn't already asked, I would have asked the same.

             

            Тhe script does not work when there is a change in fields in layout Phone.

             

            Just to check on something. That sounds like you have script triggers that perform this script when data is altered. Otherwise, I don't see how the script can track any changes anywhere.

             

            As triggers have to be set on each layout where you want them, did you set the same triggers on both layouts?

             

            What triggers did you set up?

             

            And by what methods do you modify data in this table? Manually editing data or via a script?

            • 3. Re: Script problem with 1 table 2 layouts.
              executor

              Hello,

              I found my problem. In Script Triggers. I have check “OnRecordCommit”. But only for Powermeters layout. While reading your comments I realized where my error. I open the layout Phone and set check “OnRecordCommit” and set the script.

              It works

              Thank you all.