Contact us Blog

Updating records en masse (bulk updates)

With a "mass update" or "bulk update," you use just one step to update one or more fields in a large number of records, instead of the tedious and error-prone process of updating each record individually. The need for mass updates is very common; here are a few use cases.
  1. You want to reassign the ownership of a large number of records, by updating the Owner field of those records.
  2. You have identified all the leads with whom you communicated in the last several days, and you wish to change the status of all of their records from "Open" to "Contacted."
  3. You added a new custom field to one of your objects, and you wish to copy into the new field the value of an existing field.
  4. You wish to set the value of one of the fields of an object based on a calculated formula using other fields in that object.
Apsona for Salesforce enables you to perform each of these operations in a few clicks. The first two examples above are cases in which all the updated fields in all the selected records have the same value. E.g., in example 1 above, the Owner field receives the same value in all the records. We call these updates with a literal value. The second two are cases where the value of the field in a record is computed from values of that field (and perhaps other fields) in the same record, and these are called updates with expressions.

A third possibility for mass update is where there is no direct relationship between the new value and the record; for example, you might be given a list of product names and their new prices, and you wish to update the prices in your database. This case is handled using Apsona's update-via-import feature.

Summary of steps for mass update

Note that if you use "Update all", all records in the filter will be updated, even if they span multiple pages in your display. For example, your search might have produced 5,000 records, only 50 of which are shown on the page. When you click the "Update" button in the popup, all 5,000 records will be updated. If you use "Update checked", however, only the ones you checked will be updated.

Example: Change ownership of a set of opportunities

  1. Find the Opportunity records for which you wish to change ownership. You can use Apsona's search feature for this purpose.
  2. Click the Tools button on the right, and then click the "Update all..." menu item. (Note that this menu item is visible only if your system administrator has allowed you access to it. See the access rights documentation for details on how to configure this item.)
  3. The "Update records" popup window appears. This window lets you choose up to 5 fields whose values you can update.
  4. Choose the "Owner" field.
  5. Choosing that field causes the corresponding "Value" to show a dropdown containing the names of the active users in your system. Choose the user who should be the owner of the filtered records, and click the "Update" button. This will update all the selected records, and the popup will disappear.

Example: Set the value of a new custom field to that of an existing field

Sometimes we wish to temporarily copy field values from an existing field to a new field. TO achieve this:
  1. Find the records in which you wish to make this change, using any of the search mechanisms or by using checkboxes, as in the other cases described above.
  2. Click the "Update all" menu item under Tools.
  3. In the popup that appears, click the "Use field/expression" link.
  4. The popup now lets you choose a target field (into which the data should be copied) and a source from which the data should be copied. Choose these two fields as needed.
  5. Click the "Update" button.

Example: Set the value of a field using a formula

Suppose we wish to increase the prices of all the GenWatt products in our standard price books by 4%. This is an example where the new value of the Price field is not the same for all the records being updated, but is calculated using existing values in the record.
  1. Find the Product records that you wish to update, using the search features. Alternatively, select the ones you wish to update using the checkboxes to the left of the records.
  2. In the popup that appears, click the "Use field/expression" link.
  3. Choose the "Expression" radio button to indicate that the source value to use is a calculated expression.
  4. In the "Expression" box, you can use any JavaScript expression involving the names of the field in the object. Field names are surrounded by {! and } symbols, but you can imply choose a field from the "Add field" dropdown below and Apsona will add the field name into the box with the correct syntax. In the example below, the expression calculates 1.04 times the unit price.
  5. Click the "Update" button.

Some additional examples of mass-update formulas

{!UnitPrice} * 1.04 Multiply the UnitPrice field by 1.04
{!MyAddress}.split (/ /)[1] Produce the second word in the contents of the MyAddress field. This works by splitting the field's content into an array of words, and then producing the second word. We use [1] to index to the second word, because Javascript arrays start from index 0.
{!MyStreetAddress}.replace (/\b\w/g, function (l) { return l.toUpperCase(); }) Capitalize the first letter in each word in the MyStreetAddress field, make all the remaining letters lower-case, and return the result. For example, with the string 123 main sTreet, this formula would produce the result 123 Main Street.