Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Customizable Rollups: SObject row was retrieved via SOQL without querying the requested field #4177

Closed
jesslopez-sf opened this issue Apr 12, 2019 · 4 comments · Fixed by #4359

Comments

@jesslopez-sf
Copy link
Contributor

jesslopez-sf commented Apr 12, 2019

There are reports of several orgs receiving the following error when Customizable Rollups run after the NPSP 3.151 release:

SObject row was retrieved via SOQL without querying the requested field

The pattern seems to be orgs who have modified User Defined Rollups (or standard) in the Customizable Rollup UI (old references are being maintained and while no longer being queried, are still referenced). [See Issue 3945(https://github.com//issues/3945) for original reported issue and Pull Request].

Sample Stacktrace:
Stacktrace available at the time of saving the record - Class.npsp.CRLP_Operation_SVC.doRollupOperation: line 172, column 1 Class.npsp.CRLP_RollupAccount_SVC.processRollups: line 79, column 1 Class.npsp.CRLP_RollupProcessor_SVC.completeRollupForParent: line 303, column 1 Class.npsp.CRLP_RollupProcessor_SVC.startRollupProcess: line 115, column 1 Class.npsp.CRLP_RollupQueueable.runRollupsForIds: line 149, column 1 Class.npsp.CRLP_RollupQueueable.execute: line 73, column 1

--

Steps to Repeat

  1. Create scratch org with previous version of NPSP (3.150)
  2. Create field on Opportunity
    1. Name = Amount This Year
    2. Type = Formula (Currency)
    3. Formula: IF(YEAR( TODAY()), Amount, 0)
  3. Create field on Account
    1. Name = Total Amount This Year
    2. Type = Currency (16,2)
  4. Create User Defined Rollup in NPSP Settings → Donations → User Defined Rollups
    1. Opportunity Field = Amount This Year
    2. Rollup Operation = SUM
    3. Target Object = Account
    4. Target Field = Total Amount This Year
    5. Create Rollup
  5. Enable Customizable Rollups
  6. Inspect the CMT record for that User Defined Rollup. Confirm the following:
  7. Now edit the Rollup using the NPSP Settings User Interface and switch to the following values:
    1. Change Operation to Sum
    2. Change Time Frame to Years Ago and Years Ago to This Year.
    3. Make Sure the Date Field = Close Date
    4. Change the Amount field to Amount
    5. Hit Save.
  8. Inspect the CMT record now and confirm that the values have changed, but that the Opp This Year field is still referenced in Field to Roll Up and Amount Field.
  9. Create a new Account (Name = Salesforce.org )
  10. Create a new Opportunity
    1. Name = Test Opp 1
    2. Account = Salesforce.org (http://salesforce.org/)
    3. Amount = 1000
    4. Close Date = 1/1/2019
    5. Stage = Closed Won
  11. Confirm that the Total Amount This Year field on the Account = 1.

(Regression)

  1. Nos upgrade to NPSP 3.151 using MetaDeploy: install.salesforce.org (http://install.salesforce.org/)
  2. Create a new Opportunity
    1. Name = Test Opp 2
    2. Account = Salesforce.org (http://salesforce.org/)
    3. Amount = 500
    4. Close Date = 4/1/2019
    5. Stage = Closed Won
  3. Confirm the following error in NPSP Settings → System Tools → Error Log
    SObject row was retrieved via SOQL without querying the requested field: Opportunity.Amount_This_Year__c Rollups State:

--
My full Investigation will be linked to the Work Item.

@jesslopez-sf
Copy link
Contributor Author

**lurch: add

@LurchTheButler
Copy link

Tracking W-032542

@mrbelvedere
Copy link
Contributor

Included in beta release 3.158 (Beta 5)

@mrbelvedere
Copy link
Contributor

Included in production release 3.158

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants