Mass Update Records Through Batch Processing

Update the same field on multiple records through customization.

There are many times where you want to update on field on multiple records, and you don't want to do it one at a time. It is possible to do a mass update for multiple records at once by customizing a screen to do the batch processing for you. 

For example, below is a list of activities. I may wish to reassign activities currently assigned to Errol to a completely different user, like Sam. Or perhaps, I may want to select a number of records and close all of them at once. 

Doing a batch process of records is currently doable through customization. The trick is figuring out how to go about it. In the above example, I gave two scenarios. These two scenarios would be customized differently. 

In the first scenario, I wanted to change all records assigned to Errol so that it would be assigned to Sam. In this case, I am able to define the criteria that would exactly filter the records I wanted to change. In this case, I would be able to use a single Update Fields in Table action. 

In the second scenario, the user would be selecting the activities. Since I have no idea what records they would choose, I would not be able to define the criteria that would exactly filter the records I want to change. In this case, you would need to show checkboxes on the grid, and use the Loop through Grid action in conjunction with the Update Fields in Table action.

In this article, we will provide examples for these two methods. Unfortunately, we would not be able to provide examples for every single case of batch processing possible, so it is important to understand how the concept work.

Be careful with this! Once you change records on mass, it is permanent. You may not be able to undo the mass update, except manually by hand. Make sure you understand how this works before changing a large number of records.

Updating Records Where the Criteria can be Defined

As long as you can create the criteria to define the records, then this scenario can be done with the use of one Update Fields in Table action. Here are examples of criteria that can be defined, regardless of what needs to be updated:

  • All records with a start date greater than yesterday.
  • All records with the contact of Bob Crenshaw.
  • All records assigned to Errol Elumir.
  • All records set to inactive. 
  • All records. Every single one of them. 

In the following example, we are going to replace all activities assigned to one Method user, and re-assign them to another. For simplicity, we will create two dropdown fields for the user to choose two Method users, and then another button to execute the re-assignment, as shown below:

Create the Interface

The first step will be to create the interface. You could do this anywhere, even on a new screen if need be, but for this example, we are going to customize the Activity screen. 

  1. Customize the Activity List Screen. 
  2. Drag in a new section onto the canvas.
    1. Name it secReassign
    2. Move it up so it's underneath secNav.
    3. Split it into two columns and set the width of the columns to 50%
    4. Add 1x padding to the section's top and bottom.
  3. Into the right column of secReassign, drag in another new section.
    1. Name it secReassignInner.
    2. Split it into three columns
    3. Add 1x to the left padding of each cell of each column. 
  4. Into the first column of secReassignInner, drag in a dropdown object.
    1. Name it UserOld.
    2. Change its base table to Users.
    3. Add the column UserName to this dropdown object. 
  5. Into the second column of secReassignInner, drag another dropdown object, and do the exact same above steps but name it UserNew
  6. Into the third column of secReassignInner, drag in a button object, and name it Reassign.

If properly set up, it should look like this.

Now we are ready to add actions to the button!

Add Actions to Reassign User

  1. Select the ▾ icon on UserOld and select Validation Rules.
  2. Add in the validation rule: Field is Required.
  3. Select the ▾ icon on UserNew and select Validation Rules.
  4. Add in the validation rule: Field is Required.
  5. Select the ▾ icon on the Reassign button and select the Click event.
  6. Add action Validate Controls on Screen (make sure dropdowns aren't empty).
  7. Add action Show Message (always have a confirmation message).
    1. For Title: "Confirmation."
    2. For Message, type in "Reassign all the activities belonging to "
    3. For Insert a value into the message select "UserOld - Display"
    4. For Message again, append "and give them to "
    5. For Insert a value into the message select "UserNew - Display"
    6. For Show these buttons(s), select OK/Cancel
    7. For Internal notes: "Confirm user reassignment for activities".
  8. Add action Update Fields in Table.
    1. For Select a table, choose Activity
    2. Click Open criteria Builder.
      1. Add a condition.
      2. First field: AssignedTo - RecordID 
      3. Second field: Is Equal (default)
      4. Third field: UserOld - RecordID.
      5. Go < Back.
    3. For Field(s) to update, select AssignedTo - RecordID.
    4. For Update using this value, select UserNew - RecordID.
    5. For Internal notes: "Change old user to new user for activity"
  9. Add action Refresh Control (refresh the activities grid).
    1. For Select a control choose ActivitiesGrid.
    2. For Internal notes: "Update Activities Grid".
  10. In the upper right, click Close to finish adding actions.

And you're done! Your action set should look like this:

Close the design screen and test your button out. It would be good to use test data first, of course.



Updating Records Where the Criteria cannot be Defined

The second scenario is where the criteria cannot be easily defined using the criteria builder. For example, when a user has selected specific records from a grid. For this, we can loop through the grid and only process the records that are checked. 

In the following example, we are going to allow the user to select activities in a grid, and with a single click, they can mark them as completed.

  1. Customize the Activity List screen. 
  2. Find and select the ActivitiesGrid object inside secActivityList section.
  3. In its properties, expand the Columns section and check off Has a Checkbox Column.
  4. Within secActivityList, right click on the cell, select Row, then select ⊕ Insert Above
  5. Select that new row you added and change its Cell Alignment to the upper right and its bottom padding to 1x.
  6. Into that new row, drag in a Text object.
  7. Change the Text on this new text object to "Complete Selected".
  8. Select the ▾ menu dropdown on the new text object and click its Click event. 
  9. Add action Show Message (always have a confirmation message).
    1. For Title: "Confirmation."
    2. For Message, type in "Are you sure you wish to mark these actions complete?"
    3. For Show these buttons(s), select OK/Cancel
    4. For Internal notes: "Confirm completion for activities".
  10. Add action Loop Through Grid.
    1. For Select a grid, choose ActivitiesGrid
    2. Check Only select rows that are checked
    3. For Internal notes: "Loop through checked rows of activities grid".
  11. Select the ⊕ symbol on Loop Through Grid. This will ensure the next action added is embedded within the loop. 
  12. Add action Update Fields in Table.
    1. For Select a table, choose Activity
    2. Click Open criteria Builder.
      1. Add a condition.
      2. First field: RecordID 
      3. Second field: Is Equal (default)
      4. Third field: RecordID underneath the Loop heading in the dropdown!
      5. Go < Back.
    3. For Field(s) to update, select AcitivtyStatus - Display
    4. For Update using this value, use the text "Completed" (no quotation marks).
    5. For Internal notes: "Mark activity completed."
  13. Add action Refresh Grid (this time outside of the loop) 
    1. For Select a control choose ActivitiesGrid.
    2. For Internal notes: "Update Activities Grid".
  14. In the upper right, click Close to finish adding actions.

And you're done! Your action set should look like this:

Close the design screen and test this out. It would be good to use test data first, of course.

Was this article helpful?

Can’t find what you’re looking for?

Contact Us