Salesforce Cross-Org Grid Integration

The Salesforce Cross-Org Grid integration enables users to query, display, search, inline-edit, create, and delete records from any standard or custom SObject in another Salesforce Org (e.g. Developer Org, Sandbox, Production Org, or Scratch Org) directly inside AppColab Grid.

Salesforce Cross-Org Live Grid Preview


What’s Deployed

Component Name Purpose
Named Credential Salesforce_Org Connects to callout:Salesforce_Org pointing to the remote Salesforce domain
External Credential Salesforce_Org OAuth 2.0 / Client Credentials authentication
Apex Client SalesforceClient.cls REST client supporting query, describeSObject, getRecord, createRecord, updateRecord, deleteRecord
Apex Data Provider SalesforceGridDataProvider.cls Implements appcg.GridDataProviderV1 and appcg.GridDataMutationProviderV1 with dynamic schema describe and full CRUD
Permission Set Integration_Admin Grants access to Salesforce_Org external credential principal

One-Time Manual Setup

1. In the REMOTE Salesforce Org (Source Org)

  1. Go to Setup → search External Client App Manager (or App Manager → New Connected App).
  2. Create an External Client App:
    • App Name: AppColab CrossOrg
    • Enable OAuth Settings:
      • Callback URL: https://login.salesforce.com/services/oauth2/success
      • Selected OAuth Scopes: Manage user data via APIs (api), Perform requests on your behalf at any time (refresh_token, offline_access)
      • Check Enable Client Credentials Flow.
    • Click Save.
  3. Under OAuth Policies / Client Credentials Flow:
    • Set Run As / Execution User: Select an active System Administrator or Integration User.
  4. Copy the Consumer Key (Client ID) and Consumer Secret (Client Secret).

Remote Org Connected App Setup


2. In the LOCAL Salesforce Org (Where AppColab Grid is Installed)

2.1 Create the External Credential

  1. In your local Salesforce org, go to Setup (gear icon ⚙️ → Setup).
  2. In the Quick Find box, enter Named Credentials and select Named Credentials.
  3. Click the External Credentials tab → click New:
    • Label: Salesforce_Org
    • Name: Salesforce_Org
    • Authentication Protocol: OAuth 2.0
    • Authentication Flow Type: Client Credentials with Client Secret Flow
    • Identity Provider URL: Enter your remote org’s My Domain token endpoint (e.g. https://your-remote-company.my.salesforce.com/services/oauth2/token)
    • Click Save.
  4. In the Principals section, click New:
    • Parameter Name: ApiKey
    • Sequence: 1
    • Click Save.
  5. On the ApiKey row, click the dropdown arrow (under Actions) → click Edit:
    • Client ID: Paste the Consumer Key from Step 1.
    • Client Secret: Paste the Consumer Secret from Step 1.
    • Click Save.

Local Org External Credential Setup

2.2 Create the Named Credential

  1. Click the Named Credentials tab (next to External Credentials) → click New:
    • Label: Salesforce Org
    • Name: Salesforce_Org
    • URL: Enter your remote org’s My Domain URL (e.g. https://your-remote-company.my.salesforce.com)
    • External Credential: Select Salesforce_Org
    • Generate Authorization Header: Checked
    • Allow Formulas in HTTP Header: Checked
  2. Click Save.

Local Org Named Credential Setup


3. Assign Permission Set Access

  1. In Salesforce Setup, enter Permission Sets in Quick Find.
  2. Select Integration Admin (or Appcolab Grid Admin).
  3. Click External Credential Principal Access → click Edit.
  4. Add Salesforce_Org - ApiKey to Enabled External Credential Principals.
  5. Click Save and verify the permission set is assigned to your Salesforce users.

Creating a Cross-Org Grid Definition

  1. In Salesforce, open AppColab Grid app → Grid Definitions tab → click New Grid Definition.
  2. Fill in:
    • Grid Settings Name: Remote_Opportunities_Grid
    • Grid Label: Remote Org Opportunities
    • Is Active?: Checked
    • Data Provider Class: SalesforceGridDataProvider
    • Data Provider Configuration:
      {
        "sObject": "Opportunity",
        "fields": "Id, Name, StageName, Amount, CloseDate, Type"
      }
      

      Tip: You can query any standard or custom object from the remote org!

  3. Click Save & Next → proceed to Preview.
  4. The Grid queries the remote org in real time, automatically discovering field types, picklist values, and relationships!

Cross-Org Grid Definition


Supported Grid Features

Feature Details
Dynamic Schema Describe Calls remote /services/data/v64.0/sobjects/{sObject}/describe to auto-detect labels, picklist values, and data types
SOQL Query Generation Converts user search, sort, and pagination into optimized SOQL executed in the remote org
Inline Editing Inline edits in the grid execute remote REST PATCH calls to update records in the remote org
Remote Record Creation Create new records in the remote org directly from the grid interface
Remote Record Deletion Delete remote records with automatic confirmation dialogs

Troubleshooting

  • INVALID_SESSION_ID: The OAuth access token has expired. In Named Credentials, ensure the Client Credentials flow is enabled and the Run-As user in the remote org is active.
  • INVALID_FIELD / sObject type does not exist: Verify the SObject API name and field names match the remote org’s schema.