• Carla Urquiza Mendez
  • NEWBIE
  • 0 Points
  • Member since 2019

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 3
    Replies
User-added image<apex:page > 
    <h1>Appointment Table</h1> 
    
    <apex:pageBlock title="Select a doctor">
        <apex:pageBlockSection title="doctor">
        </apex:pageBlockSection>
    </apex:pageBlock>
     <apex:pageBlock title="Working Hours Start    ">
    </apex:pageBlock>
    <apex:pageBlock title="Working Hours Ends    ">
    </apex:pageBlock>
     <apex:pageBlock title="Select a patient">
        <apex:pageBlockSection title="patient">
        </apex:pageBlockSection>
    </apex:pageBlock>
</apex:page>
  • September 25, 2019
  • Like
  • 0
I have my own Salesforce consulting practice, based in the general New York area of the US.  We do a lot of work with a Salesforce application that is designed for law firms and legal offices.  If you are interested in working with me on various on-going Salesforce projects, please contact me directly at donal@dpmtechnology.com
  • April 19, 2018
  • Like
  • 4

 
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?