Skip to main content
I received 100+ error emails overnight that all look a bit like what I've copied/pasted below. I'm not a developer and am trying to figure out how to fix this. Luckily it's in our Partial Sandbox, so is not affecting our Production org but still, would like to get to the bottom of it. From what I've read, a duplicate field error like this means there are fields with identical API names and the query errors out essentially not knowing which one to use/reference. I do see fields with the label "Amount" with identical APIs but nothing that has changed or been added in the last couple days, which makes me think why would this error suddenly come up now. Where do I find the query? How do I identify which Amount field it's looking for? And where/how do I update the query to fix this?

Error Type: System.QueryException

Error Date: 2019-12-13 04:15:20

Message: "npsp__Largest_Soft_Credit_Date__c,npo02__LastOppAmount__c,npo02__LastCloseDate__c,npo02__LastMembershipAmount__c

^

ERROR at Row:1:Column:350

duplicate field selected: Amount

Rollups State:"

Context: CRLP.ContactSoftCredit

Stack Trace:

No stacktrace available at the time of saving the record. (npsp)
10 answers
  1. Feb 24, 2023, 6:42 PM

    I think I know the answer as I just got it and fixed it. Do you have any child records being called an API name the same as a Lookup/Master-Detail relationship name? Here's my example before and after.

    SELECT Id,Cross_Section__r.Name,(SELECT Id FROM Cross_Section__r) FROM SAS_Product_Type__c

    See that I have "Cross_Section__r" twice but on two objects. The SOQL should not fail on this, but the engine fails thinking there are two.

    SELECT Id,Cross_Section__r.Name,(SELECT Id FROM Cross_Sections__r) FROM SAS_Product_Type__c

    Note the extra "s" in the "(SELECT Id FROM Cross_Sections__r)"

    Can this be my first Best Answer?
0/9000