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.

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)
- Go to Setup → search External Client App Manager (or App Manager → New Connected App).
- 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.
- Callback URL:
- Click Save.
- App Name:
- Under OAuth Policies / Client Credentials Flow:
- Set Run As / Execution User: Select an active System Administrator or Integration User.
- Copy the Consumer Key (Client ID) and Consumer Secret (Client Secret).

2. In the LOCAL Salesforce Org (Where AppColab Grid is Installed)
2.1 Create the External Credential
- In your local Salesforce org, go to Setup (gear icon ⚙️ → Setup).
- In the Quick Find box, enter Named Credentials and select Named Credentials.
- 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.
- Label:
- In the Principals section, click New:
- Parameter Name:
ApiKey - Sequence:
1 - Click Save.
- Parameter Name:
- On the
ApiKeyrow, 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.

2.2 Create the Named Credential
- 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
- Label:
- Click Save.

3. Assign Permission Set Access
- In Salesforce Setup, enter Permission Sets in Quick Find.
- Select Integration Admin (or
Appcolab Grid Admin). - Click External Credential Principal Access → click Edit.
- Add
Salesforce_Org - ApiKeyto Enabled External Credential Principals. - Click Save and verify the permission set is assigned to your Salesforce users.
Creating a Cross-Org Grid Definition
- In Salesforce, open AppColab Grid app → Grid Definitions tab → click New Grid Definition.
- 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!
- Grid Settings Name:
- Click Save & Next → proceed to Preview.
- The Grid queries the remote org in real time, automatically discovering field types, picklist values, and relationships!

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.