Loading

Financial Services Cloud: FinServ trigger errors with 'unexpected token: SUM()' or 'MAX()' on Financial Account create or update

Date de publication: May 24, 2026
Description

This article explains why the FSC managed package trigger fails with an "unexpected token: 'SUM()'" or "unexpected token: 'MAX()'" error and how to resolve it. Customers describe this as: "When user tries to change the Financial Account status to Closed, she is getting error message — FinServ.FinancialAccountTrigger unexpected token 'SUM()'" and "We're encountering an issue in our FSC org when creating a Financial Account record — FinServ.FinancialAccountRoleTrigger unexpected token 'MAX()'". The full error text is: "FinServ.FinancialAccountTrigger: execution of AfterUpdate caused by: FinServ.MoiExceptionWrapper.TriggerException: Something's not quite right. Try your action again, and if the issue continues, contact your administrator for help.: unexpected token: 'SUM()' (System Code)" or "FinServ.FinancialAccountRoleTrigger: execution of AfterInsert caused by: FinServ.MoiExceptionWrapper.TriggerException: unexpected token: 'MAX()' (System Code)". 

The trigger fires whenever a Financial Account or Financial Account Role insert, update, or status change occurs (for example, changing Status [FinServ__Status__c] to Closed). The exception is raised by the FSC managed package's Rollup By Lookup (RBL) engine when it constructs an aggregate SOQL clause from a Rollup By Lookup Configuration [FinServ__RollupByLookupConfig__c] record whose Field to Rollup From [FinServ__FieldToRollupFrom__c], From Object [FinServ__FromObject__c], or Rollup Operation [FinServ__RollupOperation__c] is blank, inactive, or references a deleted/invalid field.

Affected orgs run the Financial Services Cloud managed package in Lightning Experience on Enterprise or Unlimited Edition. RBL rules apply only to Assets and Liabilities, Claims, Financial Accounts, Financial Account Roles, Insurance Policies, and Revenues.

Résolution

Follow these steps in order. The fix targets the Rollup By Lookup configuration that is producing the malformed aggregate clause.

Cause 1: Invalid or incomplete active Rollup By Lookup Configuration

  1. Navigate to App Launcher > Rollup By Lookup Configurations.
  2. Change the list view to All and add the columns Active [FinServ__Active__c], Field to Rollup From [FinServ__FieldToRollupFrom__c], From Object [FinServ__FromObject__c], Rollup Operation [FinServ__RollupOperation__c], Lookup Field [FinServ__LookupField__c], and Field to Roll Up To [FinServ__FieldToRollUpTo__c].
  3. For every record where Active [FinServ__Active__c] is True, confirm that Field to Rollup From, From Object, Rollup Operation, Lookup Field, and Field to Roll Up To are all populated and non-blank. Any active rule with a blank Rollup Operation produces the literal token "SUM()" or "MAX()" with no field, which is the exception you are seeing.
  4. Open each suspect rule and set Active [FinServ__Active__c] to False, then Save.
  5. Reproduce the failing operation. If the trigger now succeeds, the deactivated rule was the source. Edit the rule, set the missing Field to Rollup From and Rollup Operation values to a valid, existing field on the From Object, then set Active back to True.
  6. Reactivate one rule at a time, retesting after each, to isolate any additional broken rules.

Cause 2: Rollup By Lookup Filter Criteria references a deleted or renamed field

  1. Navigate to App Launcher > Rollup By Lookup Filter Criteria [FinServ__RollupByLookupFilterCriteria__c].
  2. For each criterion linked to an active Rollup By Lookup Configuration, confirm the referenced field still exists on the From Object and that the picklist or numeric value is valid.
  3. Delete or correct any criterion that references a field that has been removed, renamed, or whose data type has changed.

Cause 3: Recalculate rollups and clear corrupted aggregate state

  1. Navigate to Setup > Custom Settings > Wealth Application Config [FinServ__WealthAppConfig__c] > Manage.
  2. Click Edit on the Default Organization Level Value, deselect Enable Rollup Summary [FinServ__EnableRollupSummary__c] and Enable Group Record Rollup [FinServ__EnableGroupRecordRollup__c], and Save.
  3. Open the Developer Console and execute the following anonymous Apex to recalculate all active RBL rules:
    List<Id> rollupsToRun = new List<Id>();
    for (FinServ__RollupByLookupConfig__c r : [SELECT Id FROM FinServ__RollupByLookupConfig__c WHERE FinServ__Active__c = true]) {
    rollupsToRun.add(r.Id);
    }
    FinServ.RollupRecalculationBatchable job = new FinServ.RollupRecalculationBatchable(rollupsToRun);
    Database.executeBatch(job);
  4. After the batch completes, return to Wealth Application Config and reselect Enable Rollup Summary and Enable Group Record Rollup, then Save.

Cause 4: Bulk data load triggering RBL on every record

  1. If the error appears only during Data Loader, Bulk API, or MuleSoft data sync jobs, navigate to Setup > Custom Settings > Wealth Application Config > Manage > Setup Owner related list.
  2. Add an entry for the integration user or profile and deselect Enable Rollup Summary and Enable Group Record Rollup for that owner.
  3. Run the data load.
  4. After the load, run FinServ.GroupAssignmentBatchable (or FinServ.HouseholdAssignmentBatchable if Record Rollup Optimization is enabled) followed by FinServ.RunRBLBatchable to recalculate household and group rollups.

 

Confirm the issue is resolved by repeating the original failing action — for the Status change scenario, edit the Financial Account record, set Status [FinServ__Status__c] to Closed, and click Save; for the bulk scenario, re-run the upsert job. The save must complete with no FinServ.MoiExceptionWrapper.TriggerException error.

Numéro d’article de la base de connaissances

005385084

 
Chargement
Salesforce Help | Article