Skip to content

JustOn Object Storage

JustOn Object Storage is an add-on to JustOn that allows for externalizing Salesforce data. It is aimed at businesses that handle millions of specific object records. Using the service, businesses can archive records and save them in an external database.

In broad outline, the solution provided works as follows:

  • JustOn creates and operates the database instances that serve the object record storage.
  • Businesses that subscribe to the service configure JustOn Object Storage to communicate with their database instance.
  • When set up, businesses can back up data from their Salesforce org to the object record storage.

Info

JustOn Object Storage is available as of JustOn 2.53.

JustOn Object Storage Concepts

Object_Storage_Overview
Object storage components and their interactions with JustOn

Authorization Workflow

The authorization workflow involves the following steps:

(1) A user clicks the Login button on the Object Storage page in JustOn. This sends an authorization request to the object storage instance (https://<server_instance>/auth/salesforcesandbox for a sandbox or https://<server_instance>/auth/salesforce for a production org).

(2) The object storage instance sends an OAuth request, redirecting the user to Salesforce. The user then allows the object storage instance accessing Salesforce.

(3) Salesforce sends the authorization data to the object storage instance - token, refresh token and user information. The object storage instance adds the user, the org, tokens, etc.

(4) The object storage instance provides an object storage token to the JustOn TokenRefresh API endpoint.

(5) Finally, Salesforce redirects the user to the object storage callback URL (for example, https://<server_instance>/auth/salesforce/callback?...), which produces the success page.

Archiving Workflow

The archiving workflow involves the following steps:

(1) The user triggers a job on the Object Storage page in JustOn. This sends a REST request to the object storage service, which posts a sync job in the object storage instance. The REST request tells which objects are to be archived (or restored) and specifies the conditions.

(2) The object storage instance checks asynchronously for open sync jobs. If there is a sync job available, it posts a bulk job in Salesforce that retrieves the objects to store.

(3) Salesforce executes the bulk job that retrieves the intended objects and saves them in (one or more) batches. The batch size is customizable.

(4) The object storage instance checks for batch results. If there is a batch ready, it retrieves the included objects and saves them to the database.

Setting Up JustOn Object Storage

Info

Contact the JustOn support team to ask for the URL of your business's object storage database instance.

Setting up JustOn Object Storage requires creating a connected app:

  1. In Setup, open the New Connected App page.

    In Salesforce Lightning, navigate to Apps > App Manager, then click New Connected App.

    In Salesforce Classic, navigate to Build > Create > Apps, then click New in the Connected Apps section.

  2. Specify the app name, API name and contact email as required.

    Set, for example

    • Connected App Name: Object Storage
    • API Name: Object_Storage
    • Contact Email: your business's admin contact
  3. Select the Enable OAuth Settings checkbox.

  4. Select the OAuth scopes Access and manage your data (api) and Perform requests on your behalf at any time (refresh_token, offline_access).
  5. Specify the callback URL for your business's database instance as provided by JustOn.

    The URL may look like https://<server_instance>/auth/salesforce/callback.

  6. Click Save.

    This creates the connected app for your object storage.

  7. Copy the generated consumer key and consumer secret and send it to JustOn.

    JustOn requires the generated consumer key and consumer secret for configuring your business's database instance.

For more details, see Create a Connected App in the Salesforce Help.

Configuring Object Storage Operations

Storing data in the JustOn Object Storage requires individual archive jobs. Archive jobs define which object records (orders, invoices, etc.) are to be processed.

You set up archive jobs using the custom setting Object Storage Configuration. The object storage configurations you create are available as job types when triggering your object storage operation and as parameter values when scheduling archiving operations.

Each object storage configuration specifies the following information:

Field Required Description
Name Specifies the unique name for the object storage configuration. Will be available as an archive job option when triggering the operation.
Target Specifies the API name of the target object. That is, records of this object are subject to the intended operation.
For JustOn objects, make sure to append the namespace prefix ONB2__ when specifying the target.
Delete After Archive Specifies whether to delete the object records in Salesforce when successfully archived.
Currently, this option is not yet operational.
Date Field Specifies the date field (API name) of the target object that is effective for setting the start date and end date when triggering the operation, for example, CreatedDate or EffectiveDate.
Condition Specifies a condition (SOQL clause) to restrict the set of included records.
For details, see SOQL SELECT Syntax in the Salesforce Help.
Sync Type Specifies the job type, that is, the actual operation to be executed. Possible values include store and restore.
Currently, only store is operational.

To create a new object storage configuration setting:

  1. In Setup, open Custom Settings.

    In Salesforce Lightning, navigate to Custom Code > Custom Settings.

    In Salesforce Classic, navigate to Develop > Custom Settings.

  2. Click Manage in the row of Object Storage Configuration.

  3. Click New.
  4. Specify the information as necessary.
  5. Click Save.

    This creates the new object storage configuration setting.

Info

Create an Object Storage Configuration record for each archive job to be available for selection when triggering your object storage operation.

Accessing JustOn Object Storage

Before you can upload files to your object storage instance, you must log in.

  1. In the JustOn configuration app, open the JustOn Object Storage page.

    Navigate to App Launcher > JustOn Configuration > Object Storage.

  2. Click Log In.

    This prompts you to allow the object storage instance accessing your org.

  3. Click Allow.

    This grants the required access permissions and displays the corresponding success page.

Info

The login status is saved with your personal settings in Salesforce. That is, you are automatically connected to your object storage instance when you are logged in to your Salesforce org.

Archiving Data

Archiving data requires individual archive jobs for specific object records. You set up archive jobs using the custom setting Object Storage Configuration.

  1. In the JustOn configuration app, open the JustOn Object Storage page.

    Navigate to App Launcher > JustOn Configuration > Object Storage.

  2. Select a job type.

    Job types represent archive jobs, which individually process specific object records.

  3. Specify a start date and an end date.

  4. Click Archive.

    This invokes the archiving procedure for the object records within the specified scope.

    On the Bulk Data Load Jobs page (Setup > Environments > Jobs > Bulk Data Load Jobs), you can monitor the job progress.

Info

The object storage instance adds bulk jobs with multiple batches per job. The number of batches depends on the number of object records to be archived and will increase over time.

Scheduling Object Storage Archiving Operations

You can set up a job in order to have objects archived to the JustOn Object Storage automatically on a regular basis.

The scheduled archiving operations requires additional options. To this end, you set up the batch chain ObjectStorageChain to be executed with additional parameters.

The following parameters are available:

Parameter Possible Values Description Example Values
Interval x(w|m) Specifies the archiving period, where x is an integer, w=week, m=month. Defaults to 1m. 2w
x-y x and y are positive integers (1 .. 31), where x-y specifies a day range for a month. If x>y, then x is considered a day of the previous month. 1-15
ObjectStorageConfiguration <string> Specifies the object storage configuration that defines the archiving job type.
Must match the related custom setting name.
Archive Orders

Setting up a parameterized object storage archiving operation involves two steps:

Configuring Object Storage Chain Parameters

You create a specific batch parameters setting to pass the job type and the archiving period to the batch chain ObjectStorageChain.

  1. In Setup, open Custom Settings.

    In Salesforce Lightning, navigate to Custom Code > Custom Settings.

    In Salesforce Classic, navigate to Develop > Custom Settings.

  2. Click Manage in the row of Batch Parameters.

  3. Click New.
  4. Specify the details as required.

    • Name: Must match the Job Name to be set when scheduling the job
    • Batch Chain: ObjectStorageChain
    • Parameter 1..8: Define batch chain-specific execution options using the syntax <parameter> = <value>

      Use parameter 1 to set the interval, and parameter 2 to set the object storage configuration.

  5. Click Save.

ObjectStorageChain parameters example
Field Value Description
Name objstr_archive_orders Must match the Job Name to be set when scheduling the job
Batch Chain ObjectStorageChain
Parameter 1 Interval = 1w Sets the archiving period to one week
Parameter 2 ObjectStorageConfiguration = Archive Orders Sets ObjectStorageConfiguration

Scheduling Object Storage Chain

To schedule the batch chain, you can use either JustOn's Scheduled Jobs page or Salesforce's Schedule Apex functionality. For details, see Scheduling a Job.

Via JustOn's Scheduled Jobs page:

  1. Open the Scheduled Jobs page.

    Use the following URL https://login.salesforce.com/apex/ONB2__JobsSetup, or, if you are already logged in, append apex/apex/ONB2__JobsSetup to your org's domain name.

    As of JustOn 2.52, you can access the Scheduled Jobs page via the JustOn configuration app (App Launcher > JustOn Configuration > Jobs Setup).

  2. From the Apex Job drop-down list, select Batch Chain Job.

  3. In the Job Name field, specify the name of the batch parameters setting created before.
  4. From the Start Time drop-down list, select the preferred execution time.
  5. Click Schedule.

    This sets up the archiving operation to be executed on a regular basis at the specified time with your defined parameters set.

Info

From the Scheduled Jobs page, you can also run the batch chain immediately.

Via Salesforce's Schedule Apex functionality:

  1. In Setup, open Apex Classes.

    In Salesforce Lightning, navigate to Custom Code > Apex Classes.

    In Salesforce Classic, navigate to Develop > Apex Classes.

  2. Click Schedule Apex on top of the list.

  3. Specify the details as required.

    • Job Name: The name of the batch parameters setting created before
    • Apex Class: ScheduledBatchChain
    • Frequency
    • Start
    • End
    • Preferred Start Time
  4. Click Save.

    This sets up the archiving operation to be executed on a regular basis at the specified time with your defined parameters set.

For more details about job scheduling, see Scheduling a Job in the JustOn documentation and Schedule Apex in the Salesforce Help.