function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
JJoshJLJJoshJL 

Stale Log In

Hey All,  Just wanted to Post something for everyone that deals with handling stale logins. It hasn't ever seem to have a problem with batch updates, querying, or using the querymore function. Anyway, feel free to make changes to it as you see fit, but hopefully this will help a few people. Also, If you have a better way, feel free to post/critique this one.

VB.net, API 4.0

 

Dim relog as integer = 0

While true

****Do some Salesforce Stuff

relog = relog + 1

       If relog > 2499 Then

              loggedIn = False

              login()

              relog = 0

       End If

end while

Adjust the count Maximum  as is suited for your updates/queries,  2500 may be too large or small for  what you do. Also, it calls the standard Login script provided by the Sforce VB samples.  Anyway, Have fun

Josh