6 Replies Latest reply on Jan 4, 2011 10:46 AM by njem

    Trick to fill a new field

    njem

      Title

      Trick to fill a new field

      Post

      Maybe I stupidly stumbled on a trick for filling a new field. Say you want a new field that the contents could be a calculation but you want it to not be a calc field, or it's just a new field and you want to fill it with a default value. Create it as a calculated field so the contents you want are there. Then convert it into a text or whatever field. The text field will retain what the calculation had made

        • 1. Re: Trick to fill a new field
          philmodjunk

          True and a useful trick from time to time, but you can also define the field as text and use the auto-enter field option to specify a calculation or other auto-enter option. Then you have both the automatic data entry and still have the ability to edit the data.

          • 2. Re: Trick to fill a new field
            njem

            I did that and it gets applied to any new record I enter or any record I change, but it didn't apply to all the old records. So I would have this new field with nothing in it. By this method all the old records are filled with whatever default value or calculation is supposed to be there.

            • 3. Re: Trick to fill a new field
              philmodjunk

              By this method all the old records are filled with whatever default value or calculation is supposed to be there.

              True, but now all your new records will show this field as blank. Wink

              If you want to define an auto-enter calculation to a field that already exists and get the current records to update, you can copy your calculation expression to the clipboard and then use the Replace field Contents tool, with the calculation option to update your existing records. (You can paste the expression into the calculation dialog for Replace fields and then edit it if necessary.)

              That way both old and new records will have consistent values.

              • 4. Re: Trick to fill a new field
                njem

                Thanks. Yes by my method if you want an auto-enter value for new records then after you change the field to a text field you would have to set the auto-enter criteria. There was another issue I had with Find and Replace not finding blanks. I did work around that by making a loop to run through all records, test, modify as needed, so I could make a similar loop. This seems to be easier.

                • 5. Re: Trick to fill a new field
                  philmodjunk

                  Find and Replace and Replace Field Contents are two completely different tools. Find and Replace is located in the Edit menu. Replace Field Contents is located in the Records menu.

                  To find blank fields, enter find mode and type an = sign into the field that might be blank, then perform the find. This works as long as the field is local to the layout's current record. If it's from a related record a different type of find that omits non-blank records should be used.

                  • 6. Re: Trick to fill a new field
                    njem

                    Oh!. I didn't see that one. When I searched for ways to replace data across records that didn't come up. Still getting familiar with FM.