8 Replies Latest reply on Jan 12, 2012 8:45 AM by IanHudson

    Modifying multiple records at once

    IanHudson

      Title

      Modifying multiple records at once

      Post

      Hi there....First post. 

       

      We just upgraded to FM 11. We use it for a contacts database. My question is simple (I think).

      When I search and find multiple records, I would love to add a word to all of them at once. For instance, I look up "Canada". I get evryone in Canada, and I want to add "Hockey" to the  "things they like to do in ths country" fied. Right now, I go through and add it to each record. Surely, I can add it to them all at once?

       

      make sense?

      thanks,

      Ian Hudson

        • 1. Re: Modifying multiple records at once
          philmodjunk

          Replace Field Contents with the calculation option can do this. This tool modifies data in all records in your found set and the changes cannot be undone, so make a back up copy before experimenting with this tool. (It's also a good idea to look it up in help before using it for the first time.)

          If the "things..." table is a plain text field (not a checkbox group), you can use an expression like this in the Replace Field Content's calculation:

          Trim ( YourTable::things they like to do in ths country & " Hockey" )

          This will keep current data unchanged but append " Hockey" to the end of it.

          • 2. Re: Modifying multiple records at once
            IanHudson

            HOLY SMOKES!!!! that works. You don't know how long I have been trying to do this. Thank you so much!

             

            Now I need to make that user friendly? I don't see the average Joe doing that right......I'll start to play with it I guess

            • 3. Re: Modifying multiple records at once
              philmodjunk

              The same method can be done in a script so that all the user need do is specify the info in a global field then click a button or trip a script trigger to do the replace fields operation.

              • 4. Re: Modifying multiple records at once
                IanHudson

                thanks again, now to figure out how to do that.......

                • 5. Re: Modifying multiple records at once
                  philmodjunk

                  The script step would look similar to this:

                  Replace Field Contents [no dialog; YourTable::things they like to do in ths country ; Trim ( YourTable::things they like to do in ths country & " " & YourTable::GlobalField" )]

                  • 6. Re: Modifying multiple records at once
                    IanHudson

                    Thanks for all your help. I have spent the better part of the morning on this, and am learning. I can get the script to work, but only on a pre determined value. For instance, right now I have:

                    Replace Field Contents [No Dialog; database:: field I want to edit; Trim (Field I want to edit & ", " & Field::Firstname)]

                    This adds a comma and a space then the firstname on the record to all found records.....

                    BUT, how do I make it so the user is prompted for the value that I want added?????? I just want to have a box come up, they put the word in, and then it adds it to all the found records.....I am stuck on that.....I cannot find a script command for "input data" or "add text"

                    ??????

                    Thanks,

                    Ian

                     

                    PS....Really, thanks for doing this I really appreciate it 

                    • 7. Re: Modifying multiple records at once
                      philmodjunk

                      Define a text field with global storage.

                      Use Show Custom Dialog with the global field specified as the input field in the dialog. This will pop up a dialog where the user can enter text--that will in turn be entered into the global text field.

                      Then use that global field in your replace field contents expression.

                      • 8. Re: Modifying multiple records at once
                        IanHudson

                        YESSSS!!!! thank you so much. I have it!!!!!! Folks round here are going to be happy!

                        that was fun too.....makes me want to really dive into the FM script thing.....