How to Update API version on Deployed Apex

Update DLRS Version

First, ensure that you are on the most recent version of DLRS. Update here.

Once you are on the most recent version of the app, if your instance has any Realtime or “Watch for Changes and Process Later” rollups, you also have deployed Apex (Apex Triggers and Apex Test Classes) that is unique to your instance that has not been updated.

This Apex is not part of the DLRS “packaged code”. These Apex Triggers and Apex Test Classes are auto-generated by DLRS as a step in the rollup creation process, but they are not owned by DLRS. They are considered to be a part of your org’s personal code so in the next step you will need to update the Apex version.

Update Apex Version

There are 3 options for updating the Apex version on that deployed Apex

  1. Remove and re-deploy the Apex from a rollup
  2. Use Developer Console to update API version
  3. Use developer tool to update API version

Option 1: Remove and Re-Deploy Apex from Rollup

This first option is the same process that is used when a rollup is created on a new object and can be done with no developer skills. We recommend that you make the update in a sandbox environment and then deploy those changes to production so that you do not have any downtime for your rollups. Using a sandbox is not required, the update can also be done directly in Production, but note that while the Triggers are undeployed the rollups will not run. Removing and re-deploying usually takes only a minute or two, but this can vary.

  1. Review the deployed Apex triggers in your system and determine which Apex triggers need to be updated.
    1. To find the DLRS triggers, go to Set up > Apex Triggers.
    2. All DLRS triggers will start with dlrs_ and you can review the API version of that trigger in the list as well.
    3. Note the name of the object in the trigger that needs to be updated. E.g. Account, Opportunity, Your_Custom_Object__c, etc.
    4. You may also want to review the deployed DLRS Test Classes, in order to understand what will need to be included in the change set.
      1. Go to Set up > Apex Classes
      2. The test classes related to DLRS all start with dlrs_. \
  2. Go to the Manage Lookup Rollup Summaries tab and click on “Try Our New Wizard”
  3. Review your existing rollups and select one rollup from each Parent-Child object pairing and open it in edit modal. For example, If you have three rollups where the child object is Opportunity and the parent object is Account, select one of those rollups and open it in the edit modal.
  4. Click on the drop down at the bottom of the modal and select Manage Triggers.
  5. Once the manage page opens click on Remove.
  6. Once the removal is complete, click on Deploy.
  7. Once deployed, click on Cancel. (Yes, it feels odd, but Cancel closes the window.)

Repeat for any additional outdated Apex on other child objects.

If you updated the Apex Triggers in a Sandbox, you would need to create a change set, include both the triggers and the Apex test classes you’ve updated, and deploy the changes to production.

Option 2: Use Developer Console to update API version

Note: This process will need to be done in a sandbox and then you would need to create a change set, include both the triggers and the Apex test classes you’ve updated, and deploy the changes to production.

  1. Select Developer Console from the cog drop down menu when logged in
  2. From the File menu select Open and select Triggers
  3. Locate the DLRS triggers you want to update and double click to open
  4. Edit the API Version drop down and click and select File Save
  5. For DLRS test classes repeat the process, but select Classes

Example:

Tip: Check “Hide Managed Packages” to reduce the items in the list. You can also use the Filter field to narrow down the trigger or class you are looking for.

Option 3: Use developer tool to update API version

If you have development or deployment skills, you can pull the trigger(s) down using the SF CLI, increase the version, then deploy again. We do not provide instructions for this option, but depending on your development skills it may be a very simple and easy option.


Back to top

Declarative Lookup Roll-Up Summaries is a tool built and maintained by a community of volunteers through the Open Source Commons program. This is not a Salesforce-owned product. If you need support, go to the Trailblazer Community Group.