Do we need to check anything in a running org before making a text field as an External Id to avoid Non-selective query against large object type Exception? (Data loss, any apex errors, etc)

I have gone through the https://help.salesforce.com/articleView?id=000323572&type=1&mode=1 link where Salesforce proposed us to make the field as External Id before asked Salesforce to make custom indexing.


The main problems are: limit of 25 External ID fields per object, indexes take a while to build (can cause "Org Lock" errors to additional changes until it processes, which may take hours), and duplicate Id values can cause errors for upserts (but not queries or other actions). You can always turn off External Id attributes later if you want to, so there's little-to-no harm in turning it on. Any problems that may arise from turning it on will be detected by the platform and give you an error before turning it on, so there's no risk there, either.

  • Is there any straightway I can check the number of fields that marked as ExternalId other than referring the WSDL. – Hariprasath Jul 15 '20 at 17:21
  • 1
    @Hariprasath I thought there would have been somthing in Object Limits, but it's not there. However, if you look in Setup at the list of fields for an object, there's a column checkbox for External ID you can count manually. – sfdcfox Jul 15 '20 at 17:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.