• Hari krishna 23
  • NEWBIE
  • 0 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 3
    Replies
Hi,

We are getting the bellow error in a trigger before  insert operation of a Task record. This trigger is trying to query the matching lead records witht the Phone number.Bellow is the query where its throwing the error.
Query:
for(lead l:[SELECT id,phone,Fini_Alternate_Phone__c from lead where IsConverted=false AND IsDeleted=false AND (phone IN: phoneNum OR Fini_Alternate_Phone__c IN: phoneNum)]){  
}
 
I am sure this query will not return more than 2 or 3 matching lead records. But still its giving the error.
ERROR:
Apex script unhandled trigger exception by user/organization: 

XXXXXXXXTrigger: execution of BeforeInsert

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)

Trigger.XXXXXXXXX: line 37, column 1

Please help me to resolve this problem. Thanks 
Hi I am getting some JSON parsing error wile parsing the response.

Error: FATAL_ERROR System.JSONException: Unexpected character ('<' (code 60)): expected a valid value (number, String, array, object, 'true', 'false' or 'null') at input location [3,2]


Here is my JSON response:
{
    "count": 1,
    "next": null,
    "previous": null,
    "results": [
        {
            "uuid": "397434eb-e1d2-4c61-a4e7-29ec493e2fbe",
            "disposition": null,
            "lead_id": "6258020",
            "first_name": "Abc",
            "last_name": "Test",
            "gender": "",
            "primary_phone": "888-888-0008",
            "primary_email": "abcdefgh@abc.com",
            "secondary_phone": "",
            "secondary_email": "",
            "third_phone": "",
            "street": "",
            "street_2": "",
            "city": "",
            "state": null,
            "zip_code": "",
            "sub_sub_affiliate": "13",
            "ip_address": "",
            "datetime_qualified": null,
            "datetime_do_not_call": null,
            "datetime_contacted": null,
            "datetime_resolved": null,
            "datetime_expired": "2014-11-30T04:35:19.159",
            "datetime_scheduled": null,
            "latest_call_uuid": "a11912e6-da6a-4647-9aa2-0d72f9427a5f",
            "datetime_last_called": "2014-09-08T18:00:19.515",
            "num_calls": 15,
            "num_originations": 15,
            "num_attempts": 15,
            "num_answered": 0,
            "num_contacted": 0,
            "num_inbounds": 0,
            "num_callbacks": 0,
            "datetime_modified": "2014-09-08T18:02:06.747",
            "datetime_created": "2014-09-01T04:35:19.215"
        }
    ]
}

Can some one help me to write the JSON parser for this type of response.
Hi,

We are getting the bellow error in a trigger before  insert operation of a Task record. This trigger is trying to query the matching lead records witht the Phone number.Bellow is the query where its throwing the error.
Query:
for(lead l:[SELECT id,phone,Fini_Alternate_Phone__c from lead where IsConverted=false AND IsDeleted=false AND (phone IN: phoneNum OR Fini_Alternate_Phone__c IN: phoneNum)]){  
}
 
I am sure this query will not return more than 2 or 3 matching lead records. But still its giving the error.
ERROR:
Apex script unhandled trigger exception by user/organization: 

XXXXXXXXTrigger: execution of BeforeInsert

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)

Trigger.XXXXXXXXX: line 37, column 1

Please help me to resolve this problem. Thanks