Skip to content

Configuring Export to Cloud Storage Services

Usually, JustOn stores generated PDF files or exported CSV invoices in Salesforce files and associates them with various records like invoices, accounts or opportunities. Your organization's business may, however, require to upload the exported files to cloud storage services like Amazon S3 or Google Drive.

Depending on the files to be exported, setting up the file export to cloud storage services may comprise multiple configuration tasks:

In addition, you can monitor the upload status.

Once set up, there are various ways to upload generated files to your cloud storage:

Note

Users who are supposed to trigger a file upload to cloud storage services must be assigned the permission "Customize Application" in their profile or using a dedicated permission set.

Setting Up Storage Location

Amazon S3

JustOn can integrate with Amazon Simple Storage Service (Amazon S3) to store generated files.

Note

Before configuring JustOn to connect to Amazon S3, you must create the intended Amazon S3 buckets first. Keeping a single active S3 user credential, JustOn can access an unlimited number of buckets simultaneously.

For details, see the Amazon Simple Storage Service Documentation.

Configuring JustOn to connect to Amazon S3 involves these tasks:

Creating File Distribution Setting for Amazon S3

To temporarily hold the files to be uploaded, JustOn needs a dedicated file distribution target.

  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 File Distribution.

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

    Field Possible Values Description
    Backend AmazonS3 Specifies the backend where the target folder is located. For using Amazon S3, the value must be AmazonS3.
    Name <bucket>:<region> Specifies the exact name of the target folder, for Amazon S3 buckets, this is the bucket name and the region, separated by a colon.
    The bucket name and the storage folder name must match.
    To find your Amazon S3 region, see AWS Regions and Endpoints.
    Active (checkbox) true Specifies whether to use this folder or not. Must be selected to enable the export.
    PDF Name [InvoiceNo]_[AccountName].pdf Specifies the naming pattern used for the file name of the PDF document to be generated.
    Slashes in the naming pattern are considered folders during the S3 upload, like /[AccountNo]/[InvoiceNo].pdf.
    This is a mandatory setting, even if you intend to store exported CSV files only.
    Select Condition <SOQL WHERE clause> Specifies a condition in SQOL syntax to restrict the selection of documents that are distributed to this target.
    For more details and an example, see File Distribution Information.
    Use Case InvoicePDF | Export Specifies the intended use case for the folder:
    InvoicePDF for storing PDF files (invoices, account statements, dunning reminders), default if left empty
    Export for exported invoice/booking details CSV or SEPA XML files
  5. Click Save.

Creating Remote Sites for Amazon S3 Buckets

For each Amazon S3 bucket you intend to use with JustOn, you must configure a remote site in Salesforce.

With respect to the URLs, consider the following characteristics:

  • The region is always part of the URL, with the exception of the US East (us-east-1) region.
  • JustOn prefers to callout to virtual host style URLs like

    https://<bucket>.s3.amazonaws.com/
    
    https://<bucket>.s3-eu-west-1.amazonaws.com/
    
  • If the bucket name contains full stop characters (like foo.bar), JustOn falls back to path style URLs:

    https://s3.amazonaws.com/<bucket>
    
    https://s3-eu-west-1.amazonaws.com/<bucket>
    

To configure a remote site:

  1. In Setup, open Remote Site Settings.

    In Salesforce Lightning, navigate to Security > Remote Site Settings.

    In Salesforce Classic, navigate to Security Controls > Remote Site Settings.

  2. Click New Remote Site.

  3. Specify the details as necessary.

    For information about the mandatory fields and possible values, see Configure Remote Site Settings in the Salesforce Help.

  4. Click Save.

Amazon S3 Bucket Configuration Examples

Bucket Name Region Document Folder Name File Distribution Setting Name Remote Site Setting URL
foo US East foo foo:us-east-1 https://foo.s3.amazonaws.com/
foo.bar US East foo.bar foo.bar:us-east-1 https://s3.amazonaws.com/
foo EU Central foo foo:eu-central-1 https://foo.s3-eu-central-1.amazonaws.com
foo.bar EU Central foo.bar foo.bar:eu-central-1 https://s3-eu-central-1.amazonaws.com

Granting Amazon S3 Access for JustOn

Before JustOn can upload files to your Amazon S3 storage, you must grant it the corresponding access rights.

  1. Open JustOn's Amazon S3 page.

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

    As of JustOn 2.52, you can access the Manage Amazon S3 page via the JustOn configuration app (App Launcher > JustOn Configuration > Manage Amazon S3).

  2. Specify your AWS Access Key ID and Secret Access Key in the corresponding fields.

  3. Click Save.

Info

JustOn's Amazon S3 page also allows to repeat the upload in case the job has failed, clicking Upload Remaining Documents, and to provide a new Access Key ID and Secret Access Key for another AWS account.

Google Drive

JustOn can integrate with Google Drive to store generated files.

Creating File Distribution Setting for Google Drive

To temporarily hold the files to be uploaded, JustOn needs a dedicated file distribution target.

  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 File Distribution.

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

    Field Possible Values Description
    Backend GoogleDrive Specifies the backend where the target folder is located. For using Google Drive, the value must be GoogleDrive.
    Name Google Specifies the exact name of the target folder.
    If the folder does not exist, Google Drive creates it applying the specified name.
    Active (checkbox) true Specifies whether to use this folder or not. Must be selected to enable the export.
    PDF Name [InvoiceNo]_[AccountName].pdf Specifies the naming pattern used for the file name of the PDF document to be generated.
    This is a mandatory setting, even if you intend to store exported CSV files only.
    Select Condition <SOQL WHERE clause> Specifies a condition in SQOL syntax to restrict the selection of documents that are distributed to this target.
    For more details and an example, see File Distribution Information.
    Use Case InvoicePDF | Export Specifies the intended use case for the folder:
    InvoicePDF for storing PDF files (invoices, account statements, dunning reminders), default if left empty
    Export for exported invoice CSV or SEPA XML files
  5. Click Save.

Granting Google Drive Access for JustOn

Before JustOn can upload files to your Google Drive storage, you must grant it the corresponding access rights.

  1. Open JustOn's Google Drive page.

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

    As of JustOn 2.52, you can access the Manage Google Drive page via the JustOn configuration app (App Launcher > JustOn Configuration > Manage Google Drive).

  2. Specify your Google user name in the corresponding field.

  3. Click Authenticate.
  4. Follow Google's instructions to authenticate yourself and to allow JustOn to access your Google Drive storage.

    Once completed, you are taken back to JustOn's Google Drive page.

Info

JustOn's Google Drive page also allows to repeat the upload in case the job has failed, clicking Upload Remaining Documents, and to revoke JustOn's access to the current Google account.

Defining Specific Export Settings

If you intend to directly upload generated invoice CSV files to your cloud storage, you need a specific CSV export setting. You can adjust an existing setting or create a new one - just make sure to specify the exact document folder name as the export target.

  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 Export Settings.

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

    Field Possible Values Description
    Name S3 A unique name for the custom setting record, will be selectable when exporting invoice data.
    Active true | false Determines whether the configuration is available in the UI.
    Configuration <Salesforce record ID> Specifies the Salesforce record ID of the JSON configuration file, which is required for CSV exports
    Create Payments true | false Determines whether to create payment balances on the invoices upon exporting, which sets the invoices Paid or Settled.
    Users can overwrite this option manually when starting the export.
    Format Invoice CSV Determines the export format.
    Select Condition Date__c = THIS_YEAR Specifies a condition (SOQL WHERE clause) to restrict the set of included records. If empty, matches all invoices in the scope.
    For details, see SOQL SELECT Syntax in the Salesforce Help.
    Target Export Specifies the name of a file distribution target for the exported files.
    Note that the file distribution target must be the one set up for the invoice export to your cloud storage service (see Setting Up Storage Location).
  5. Click Save.

Monitoring Cloud Storage Export

For administrative purposes, you may need to monitor the cloud storage export. JustOn therefore keeps track of the external targets and the corresponding upload status. To this end, it adds specific fields to the Content Version object, which are then used to maintain the corresponding information for the Salesforce files.

The following fields are currently available:

Field Values Description
External Targets JSON String Holds a list of all cloud folders (and the associated status) to which the file will be or has been uploaded.
Amazon S3 Transfer Status New, Partial, Transferred Maintains the cumulated transfer status over all single Amazon S3 folders of the external targets.
Google Drive Transfer Status New, Partial, Transferred Maintains the cumulated transfer status over all single Google Drive folders of the external targets.

Next steps:

Redistributing Invoice PDF Documents
Redistributing Account Statements
Redistributing Dunning Reminders
Exporting Invoices

Return to JustOn Administration