4 Replies Latest reply on Jul 31, 2014 2:50 PM by DLarsen

    Replace Field Contents


      Is there a way in a script to just replace the field contents in the record you are looking at rather than the current found set?


      I'm just trying to replace an A with a D in one field just on the record I'm looking at before moving onto the next record



        • 1. Re: Replace Field Contents

          Set Field ( my field, new contents )?



          • 2. Re: Replace Field Contents

            Thanks Beverly- it works a treat!


            (my previous effort with Replace wiped the data from the field in every record - fortunatley I had a back up!!)

            • 3. Re: Replace Field Contents
              Stephen Huston

              riggers wrote, in part: Replace wiped the data from the field in every record…!

              That's a reminder of why I disable/remove that Replace  option in the pulldown menu for users via a Custom Menu. If it's left available, someone will try it to see what it does, and…

              • 4. Re: Replace Field Contents

                Hi Riggers,



                Set Field is one of the most commonly used script steps. I hardly ever use the other steps like INSERT, PASTE etc. Set field is my method of choice because you can specify the the exact field you want to set and you can set it to literal text , numbers, or calculations.



                An additional benefit is that the field doesn't have to actually appear on the current layout unlike PASTE for instance.



                You can even set a field to itself. For instance if my field currently held the value of "Blue" I could make it "Red, White and Blue" with this command:



                Set Field ( YourField ; "Red, White, and " & YourField )



                Very powerful.



                You should also be aware that Set Field works in Find mode too. For instance If I wanted to find the word "White" I could write a script like this:



                Enter Find Mode

                Set Field ( YourField ; "White" )

                Perform Find



                Good luck!