5 Replies Latest reply on Jul 25, 2016 8:21 AM by DHunt

    Lookup.ini Swapping Fields

    alanh102 Rookie

      I would like to put in "S" in a field and two fields auto-swap their contents.

       

      Here is what I have so far as a small sample. When "S" is put in the uname field I want the contents of usic and uforecast fields to swap their contents automatically.

       

      [AutoUpdate]
      uname=UFORECAST,usic

      [uforecast]
      lookup1=uname
      S=&contact2->usic
      overwrite=1

      [usic]
      lookup1=uname
      S=&contact2->uforecast
      overwrite=1

       

      Any helps is appreciated.

       

      Thanks.

        • 1. Re: Lookup.ini Swapping Fields
          John Neighbors Expert

          You are probably NOT going to be able to do it in this simplistic of a manner. 

           

          Reason: 

           

          GoldMine will do one update (e.g. UFORECAST) and then the other (e.g. USIC).  Well, after the first update, the data originally in that field (UFORECAST) is no longer available to be placed into the second field (USIC).  At that precise moment in time, both fields hold the value that was originally in USIC.

           

          A potential solution:

           

          Have a 3rd "temporary field" available for the shuffling the data.

           

          High level concept:

           

          a. Copy UFORECAST to UTEMP.

          b. Copy USIC to UFORECAST.

          c. Copy UTEMP to USIC.

           

          A POSSIBLE LOOKUP.INI approach:

           

          [AutoUpdate]

          uname=UTEMP,UFORECAST,usic

           

          [utemp]

          lookup1=uname

          S=&contact2->uforecast

          overwrite=1

           

          [uforecast]

          lookup1=uname

          S=&contact2->usic

          overwrite=1

           

          [usic]

          lookup1=uname

          S=&contact2->utemp

          overwrite=1

           

          NOTE:  I have NOT invested the specific time to "test" this, so I may be missing a specific meticulous detail here.  However, I hope you get the gist of what I'm suggesting?!?!?  Clearly test very thoroughly and carefully.

           

          Hope this feedback helps.

          • 2. Re: Lookup.ini Swapping Fields
            alanh102 Rookie

            Thanks John. I figured I may need something like that. I will test it out and let you know.

             

            Thanks.

             

            Alan

            • 3. Re: Lookup.ini Swapping Fields
              alanh102 Rookie

              I did some testing and it seems to work. I will fully test it out, but it appears to work.

               

              Thanks.

               

              Alan

              • 4. Re: Lookup.ini Swapping Fields
                JMessi Apprentice

                I would also turn on log of history for changes, just in case.

                • 5. Re: Lookup.ini Swapping Fields
                  DHunt Specialist

                  John's solution is the correct solution to this question.

                   

                  Turning on Log Changes in History, I don't believe, has any effect when the changes are made via the Lookup.ini.