• Pinkey
  • NEWBIE
  • 0 Points
  • Member since 2013

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 3
    Replies
anyone know why below code errors out with a message "Session expired or invalid"

.ajax({
                    url: '/services/data/v28.0/sobjects/Attachment/',
                    type: 'POST',
                    data: '{"ContentType": "image/tiff", "Name" : "REST_API_Application", "ParentId": "'+self.model.get('Id')+'", "Body": "'+responseData.data+'"}',
                    contentType: 'application/json',
                    processData: false,
                    beforeSend: function(xhr) {            
                        xhr.setRequestHeader('Authorization', 'Bearer '+sessionId);           
                    }


session id is defined in VF page
var sessionId = '{!$Api.Session_ID}';

 
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
I can't believe no one out there has wanted to do this but I've searched and searched and haven't found anything similar.  Specifically when converting a lead with an opportunity we'd like it to immedietly go to the add product page for the opportunity or at least just the page for the opportunity that was just created.  It seems like there should be some way to do this.  Something must tell it that it was just at the lead page and is now at the account page even if it's an existing account.  I just can't find how.  If anyone has any ideas on this I would love to hear them.

Thanks,
Amanda
Hi,
We have this vf page which works fine but links dont open in console, it opens in normal case page layout

<apex:page StandardController="Case" tabStyle="Case" Extensions="RecentEsc">
    <apex:form style="width:100%;height:400px">
        <apex:pageBlock mode="maindetail">
                <apex:pageBlockTable value="{!Resultsall}" var="o">
                        <apex:column headerValue="Case Number">
                           <apex:outputLink value="/{!o.id}" target="_blank">{!o.CaseNumber}</apex:outputLink>
                        </apex:column>
                        <apex:column headerValue="Contact Name" value="{!o.Contact.Name}"/>
                        <apex:column headerValue="Status" value="{!o.Status}"/>
                        <apex:column headerValue="Priority" value="{!o.Priority}"/>
                        <apex:column headerValue="Subject" value="{!o.Subject}"/>
                        <apex:column headerValue="Date/Time Opened" value="{!o.CreatedDate}"/>
                        <apex:column headerValue="Owner Name" value="{!o.Owner.Name}"/>
                </apex:pageBlockTable>
        </apex:pageBlock>
    </apex:form>
</apex:page>

How do i ensure it opens in service console.
I noticed this online but not sure how to use this code on page above.
http://www.salesforce.com/us/developer/docs/api_console/Content/sforce_api_console_sample_vf.htm

thanks