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
kosmitevkosmitev 

Scheduled Apex class call external web service and pass session id

Hi,

We have a composite application which does some batch processing inside of SF.

Our customers would now like to schedule those batch jobs to run at particular times.

The problem I am having is how will the batch job establish a session with Salesforce.

The only way that I see is if we store the username and password of our users with us which I do not want to do.

 

Is there any way for our users to schedule an Apex class within SF which invokes a webservice at our end passing in session id so that we can connect to SF?

Or is there any better suggestions on how to achieve the taks without storing the usernames and passwords?

 

Thanks,

Kos

Best Answer chosen by Admin (Salesforce Developers) 

All Answers

kosmitevkosmitev

Thanks Cory,

I think that will be a better option than asking for usernames and password.

It does not seem as trivial to implement but will give it a try.

 

Regards,

Kos