Changing
Area Codes via Group Replace function
From
time to time, your phone company may go through an area code change
for some areas of your city. That's all fine and dandy if you
only have 2 or 3 people that live in that area. But what if you
have 300? Do you have to go and change them all one by one? Thankfully
no, there is a feature that allows you to change a group of records
all at once. It's called a Group Replace. It is available from
Contact Utilities portion of the Contact menu (version 3x) or
the Contact Manager menu (version 4x). The feature works basically
the same in both versions. The process works like this:
·
First, create a filter that contains only the records you want
to replace. In this case, it will be for those records in the
specific area code(s) that will be changing. A common filter to
do this uses the SUBSTR() function to pull a portion of the phone
number field to make the comparison. I'll use our phone number
514-907-1174 for an example. To change the area code of the exchanges
222 through 666, you would have to first pull out the exchange
portion of the phone field. The expression will vary depending
on the format of the phone field, but the logic is the same. In
a Contact Browse window, count the number of places to get to
the first digit of the exchange. In our phone number, it is in
the 5th position. We also know that the exchange is only 3 characters,
so now we have all we need to use the SUBSTR() function. It works
like this: SUBSTR(, , ). Then you should compare that to the exchange
that you will be looking for. So for us it looks like this:
SUBSTR(contact1.phone,5,3)>"222"
and SUBSTR(contact1.phone,5,3)<"666"
· Next, make sure the filter works properly by applying it in
the contact manager.
There is no "undo" for a group replace so you will want to make
sure that the filter only contains the appropriate records. If
you accidentally replace the incorrect records, you will need
to restore the contact data from, backup.
·
Now choose the "Group Replace" option from the Contact Manager/Contact
Utilities menu.
· Click on the level you wish to replace data on. You will see
a list of fields.
· Select the field you wish to replace. You will see a "Replace
Value" box.
· Click "Advanced"
In the expression builder dialog box, type in the replace expression.
This expression will be for "what is going into the field." In
Our example, the area code will change from 416 to 555. So the
first part of the expression will be just the area code. Next,
we want to retain the rest of the data in the field. Since this
expression is really "what is going into the field," if you don't
make that a part of the replace expression, all you will have
in the phone field is the area code. Similarly to the filter we
created, you will use the SUBSTR() function to return the rest
of the phone field. This time, you will start at the next character
after the area code (which we know would be position number 4).
It should look something like this:
"555"+SUBSTR(conact1.phone,4)
Leaving off the second argument of the SUBSTR() function simply
tells it to go to the end of the field and not to return only
a specific number of positions.
You
must have the correct expression in this box or you could replace
incorrect data in the field. My suggestion is to first tag a couple
of test records and attempt the replace on the "Tagged Records"
filter first before using it on your final filter.
·
Click OK to the expression box.
· Finally, make sure your filter
is in place and click -Replace.
This process will go faster if there are no users in TeleMagic,
but you can still do it if you cannot kick everyone out.
This
is just one application of a group replace. Another use is where
an associate leaves your company and you need to assign all their
records to someone else. You can use it in any instance where
you need to change a large number of records. It's a very powerful
feature, but remember that you cannot undo once it is done. It
is always best to test the replace on a select few records or
on a copy of the
--
End of FAQ #549