Debug Logs for PostInstallHandler SuperUser

I have a PostInstallScript (without sharing) that schedules a job which I need to see in Debug Logs. However, the job is run under SuperUser mentioned in this question. I have gone through the answer for it and comments section, but were unable to find any useful information on how to debug my Scheduled Job that runs under this specific user.

This user doesn’t appear in the users list in Setup -> Debug Logs, it is neither an Automated Process User, nor Platform Integration User.

Has anyone encountered such a problem? Is there any solution for it?

Note: I have tried to schedule job from method with @Future annotation, but no luck.

UPDATE

Do NOT try to schedule jobs from PostInstallHandler, because somehow SuperUser’s permissions are volatile and after Spring ’22 relesed it cannot cooperate in scheduled jobs with package custom objects and it throws Exception like (we think that it was connected to Spring ’22 release):

Apex script unhandled exception by user/organization: .../...

Scheduled job 'SCHEDULED_JOB_NAME' threw unhandled exception.

caused by: line LINE, column COLUMN: Dependent class is invalid and needs recompilation:
Class CLASS : DML operation Delete not allowed on MANAGED_PACKAGE_CUSTOM_OBJECT

Answer

Attribution
Source : Link , Question Author : Mariia Illarionova , Answer Author : Community

Leave a Comment