• Deepak Mishra 34
  • NEWBIE
  • -2 Points
  • Member since 2019

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

 
Hi all,

We need to implement the following pattern at my org:
  • callout to external data source
  • if that callout takes too long (according to some configurable threshold), log an error (ie do some DML)
  • if that callout timed out on the remote server, try it again
Recognizing the potential for the dreaded "You have uncommitted work pending. Please commit or rollback before calling out." error, I put the error logging code in a future method, thus isolating the DML from the callouts. However, the error is still being thrown. I reduced the issue down to this pattern:
public static void foo() {
    Http http = new Http();
    HttpRequest req = new Httprequest();
    req.setEndpoint('https://test.salesforce.com'); //whatever endpoint
    req.setMethod('GET');
    http.send(req); //works fine
    bar();
    http.send(req); //throws calloutexception
}

@future public static void bar() {

}
Am I correct to assume that calling a future method counts as a DML operation? Is there any documentation I'm missing somewhere?

 
Dear all,

We're looking at the various options of using Salesforce mobile (Salesforce1 application, SF1 Browser, Salesforce Classic in the browser) and are finding limitations with each:

Salesforce 1
  • Overriding the "View" action on an SObject appears to have no effect at all in SF1 and the standard page is displayed
  • The lack of ability to override the Edit action and then return to the normal edit page if the override logic requires it
What have people done to fix their existing overrides when they move to SF1?
 
Salesforce Classic in Mobile
  • If you direct to the full Salesforce classic site in mobile (i.e. switching off the "Enable the Salesforce1 mobile browser app" setting), the UIThemeDisplayed variable still seems to think that the user is in SF1
Lightning Experience
  • With Lightning Experience switched on and "Enable the Salesforce1 mobile browser app" switched off, the user cannot log-in on mobile
  • With Lightning Experience switched on and "Enable the Salesforce1 mobile browser app" switched on, the user is directed to SF1, despite Lightning Experience being responsive to different screen sizes, etc.
Does anybody have any advice, answers or workarounds to these questions? It makes mobile development very difficult when the navigation behaviours/capabilities in the desktop and mobile version differ so wildly.

With thanks,
Andy

I have a list I need to sort by a primary key as well as a secondary key - I tried ORDER BY fieldName AND fieldNAME as well as ORDER BY fieldName AND BY fieldName - neither one compiled on save. 

 

Any ideas? 

 

Thanks!

 

JoAnn