How to execute scheduled job by fetching domain specific credentials?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-29-2025 09:54 AM
I have a scoped app that supports MSP. The scheduled job is bundled with the app as a global domain scope. The app has credentials, connection aliases, and HTTPS connection records for each domain. The app script fetches the current domain and the connection and credentials of that domain to fetch the domain-specific records from the table.
When a scheduled job is executed, it's executed as sys_user, so it cannot fetch the domain ID of the logged-in user. The function is unable to fetch the domain-specific records from the table as the domain ID is not available.
How to get the domain ID of the current logged-in user while executing a scheduled job for a particular domain?
How to set a different scheduled frequency for each domain for the scheduled job that is bundled with scoped app global domain?