Skip to content

Support for multi-tenancy #3

Description

@corytheboyd

I have a multi-tenant application, and need to create Batch Jobs for many different Salesforce organizations, which means many different Restforce clients. It would be great if the Job creation API supported that, as it's effectively hard-coded to Restforce::Bulk.client as far as I can tell.

From what I can tell, I can do it by basically re-implementing Restforce::Bulk::Job::create, but that isn't very clean:

# My own application code, used to get Restforce::Data::Client instance for a User.
restforce_client = User.first.get_restforce_client

bulk_client = Restforce::Bulk::Client.new(restforce_client)
job_builder = Restforce::Bulk::Builder::Xml.new(:query)
job_data = job_builder.job('Contact', 'CSV')
job_create_response = bulk_client.perform_request(:post, 'job', job_data)
job = Restforce::Bulk::Job.new(job_create_response.body.jobInfo)

Almost seems like that should be:

bulk_client = Restforce::Bulk::Client.new(restforce_client)
job = bulk_client.create_job(:query, 'Account', :csv)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions