Bikur Cholim בקור חולים

Tuesday, December 23, 2014

Replacing Text in a Field

Replacing Text in a Field:
Need to find out the difference between “Set Field [ ]” or, since you want all records, “Replace Field Contents [ ]” (Source: [ii]):
Replace Field” updates the specified field for ALL records in the current found set, not just the current record. 
“Set Field” only Replaces the Field Contents in the Current Record (Source: [iii]).
There are two good options I can think of:

  1. One is the Find and Replace Command. 
  2. The other is the Replace Field Contents Command. 

Both of these can operate on all records in a found set. 
One problem you may run into with either of these in a multi-user setup is record locking problems. 
If another user is editing a record that is in your found set, you won't be able to do the replace.
One way around this is to use “Set Field [ ]” in a looping script. 
Then you can check for record locking and receive notification about which records weren't modified.

Would there be any point? 
The “Replace” Command is designed to operate on the whole found set. 
The “Set Field” Command will do a similar thing for only the current record.