• bdouglas1
  • NEWBIE
  • 0 Points
  • Member since 2012

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 3
    Replies

I'm taking new projects in the SoCal area.  I have over five years SFDC experience and 13 years in consulting and software development.  Please contact me at bdouglas1@gmail.com.  

We have a production org with a managed packaged installed that is working fine.

A sandbox is created from this production org with no data and we see the following error when saving a new Case:

Apex trigger XXXXX.MC_CaseTrigger caused an unexpected exception, contact your administrator: XXXXX.MC_CaseTrigger: execution of AfterInsert caused by: System.QueryException: Non-selective query against large object type (more than 100000 rows). Consider an indexed filter or contact salesforce.com about custom indexing. Even if a field is indexed a filter might still not be selective when: 1. The filter value includes null (for instance binding with a list that contains null) 2. Data skew exists whereby the number of matching rows is very large (for instance, filtering for a particular foreign key value that occurs many times): (XXXXX)

This is the final statement in the debug log, so I guess this is what causes the problem:
15:23:46.313 (2313202218)|SOQL_EXECUTE_BEGIN|[8]|Aggregations:0|select id from CaseRoutingRequest__c

So it is selecting all Ids from CaseRoutingRequest__c. I know this is not ideal and the query should have a limit added, however there is change control in place around this managed package preventing change for the time being and it shouldn't be a problem because...

When I execute the same select in developer console it runs fine and comes back with zero rows.

There are no CaseRoutingRequest__c objects present, so why is Salesforce giving us this error? Is it undocumented behaviour? Is it a bug? Why does it work in some orgs but not this one?
  • January 27, 2015
  • Like
  • 0

How can I attach a file to a visualforce email template? 

 

Use Case – we are sending out a visualforce email from the Custom_Object_1__c object and listing info from the related list Child_Object__c.  Now I want to attach to the email any and all files that are listed in the Notes & Attachment related list for Custom_Object_1__c.

 

Thanks,

Kevin