I’m developing a managed package and have a requirement to implement functionality that automatically uploads files attached on managed package object at regular intervals on some external drives like Gdrive or Onedrive. After researching, I find the following solution:
-
I will create a component into our package to obtain external drive credentials and save them in custom metadata.
-
I will create a batch job that runs periodically. Inside start method, it will obtain an access token and store it in a static class-level variable.
-
In execute method, the batch job will use this access token to upload files to the external drive.
Is this approach appropriate? What are its implications, and are there alternative approaches I should consider?