Reply
Regular Visitor
musina
Posts: 2
0

Issues with the scheduled job added by Post Install class

Hi All,

 

I have a package which adds a scheduled job in the post install class. The job is being added, with the submitted by my package. The apex job seems to run at the scheduled time, but the actions from that script are not performed.

 

If I delete the job and schedule it again the script actions are performed normally.

 

Does anyone know how I could solve this issue?

 

Trusted Contributor
admintrmp
Posts: 332
0

Re: Issues with the scheduled job added by Post Install class

[ Edited ]

You are brave to try this. The install handlers are terrible. It would be a miracle to get one to do what you want it to.

 

On a side-note, I do not have the answer to your question. Sorry.

Regular Visitor
Eric-He
Posts: 1
0

Re: Issues with the scheduled job added by Post Install class

Hi, did you figure out the reason for this issue? Did you get a chance to fix it? I am having the same issue with scheduling an apex job from post-install script. 

 

As referenced in the documentation, the post install scripts run as a specil system user that represents your package, so all operations performed by the script appear to be done by your package. If you check your scheduled jobs from monitor, you will find your scheduled job is submitted by a user, who doesn't exist any more, after the package is installed. But the apex class in the schedule is still trying to execute with that user, I think that's the reason for this issue. But I cannot find a way to fix it, I guess it's SF bug.

 

Anybody has the same issue?

Regular Visitor
musina
Posts: 2
0

Re: Issues with the scheduled job added by Post Install class

I wasn't able to figure out how to get this working. I had to make some workaround and the first time the app is being set up I add the scheduled jobs as well and this way is being added by a real user.