Skip to content
English
  • There are no suggestions because the search field is empty.

Salesforce Integration Documents - Installing Version 3.3

Package Setup

Install the Case Xchange managed package into your Salesforce org using the installation link provided below.

Installation

When prompted, choose Install for Admins Only — you will grant access to other users via Permission Sets after setup is complete.

We always recommend testing everything in a sandbox first.

Configuration

Once installed, follow the instructions found in the newly installed Case Xchange App after assigning yourself the Case Xchange Admin permission set.

The page in the Case Xchange App should appear titled "Case Xchange Admin v3". If that does not show up, edit the page and click Save, then add the new page to the app and remove the old one. Updates to managed packages do not always update app pages, so this step may be necessary when upgrading.

Follow the instructions there, or as listed below:

  1. Log in to Case Xchange and navigate to the Settings tab, then click Integrations and Manage next to Salesforce. Under API Tokens, click Generate Token and save the generated token somewhere safe — it is only shown in full this one time.
  2. Click Update Credential in Authorization Setup, input the token generated above, and select the environment (unless given specific access to Case Xchange's UAT environment, you should select Production). Wait a moment for it to save, then click Test Connection to ensure everything worked correctly. If it does not immediately work, refresh the page and try again — it can take a few minutes for the credential to fully save.
  3. Select Mappings in CX Field Mappings. A Source Object is required, as that is where the referral will be sent from. A Destination Object is optional but required if you want to track any data coming back from Case Xchange.
    • For now, the integration only supports fields that are directly on the source object, so lookup fields cannot be used.
    • If using a destination object, ensure the integration setup in Case Xchange is complete under Settings → Integrations.
  4. Add the caseXchangeReferral LWC to the Lightning record page for the source object.
  5. Begin referring.

 

Authorization Notes

This integration uses a Named Credential and External Credential to provide information about the endpoint. The actual API key is stored in custom metadata so it can easily be edited (though because it relies on the Metadata API, it may take a few minutes for any key updates to be reflected).

The endpoints used in the package are similar to (but a subset of) those published in our public API. See the public API reference for additional detail if helpful: https://docs.casexchange.com/

Package Components

caseXchangeReferral LWC

This is the original backbone component for sending referrals. It can be replicated via Flow, but the LWC may load faster. It must be installed on the object you want to send referrals from. The recordId variable is not needed when adding it to a Lightning record page.

Permission Sets

The package includes three permission sets. Assign them based on each user's role.

 

Permission Set Name Assignment Notes Permissions Granted

Case Xchange Admin

System administrators and anyone who configures the Case Xchange integration.

Grants full access to all package components, including:

  • All invocable actions and Apex classes
  • Full read/write access to integration objects (CX_Field_Mapping__cCX_Intake__cCX_Mapping__cCX_OAuth_Token__c)
  • Read-only access to API logs (CX_Log__c)
  • Access to the Authorization Setup tab and OAuth configuration tabs
  • Ability to create log events

This permission set is required to complete the authorization setup described above.

Case Xchange Referral Permissions
Uses who need to send or manage referrals via Case Xchange flows or components.

Grants:

  • Access to all invocable actions and the referral controller
  • Read-only access to integration objects
  • Read and edit access to Case Xchange fields on the Case object (CaseXchange_Case_ID__cCaseXchange_Reference_No__cCaseXchange_Status__c)
  • Access to the OAuth callback page (required for the connection flow)

Assign this permission set to attorneys, paralegals, or intake staff who will use Case Xchange flows.

CX Log Access
Users or audit accounts that need to view the full API log.

Grants full CRUD access to CX_Log__c and the ability to create log events (CX_Log_Event__e). This is typically only needed for admins or advanced users troubleshooting API activity.

 

 

Invocable Actions Reference

All actions are available in Salesforce Flow Builder under the Case Xchange category. Each action returns an isSuccess (Boolean) field and an error field — always check isSuccess before using output values. 

Error Output 

When isSuccess is false, the error field contains: 

  • code — A machine-readable error code (e.g., invalid_status, not_found) 
  • message — A human-readable description of what went wrong 

 

Create Sent Case 

Label: Create Sent Case (CaseXchange) 

Creates a new case in CaseXchange. If a referentFirmId is provided, the case is immediately sent to that firm. Otherwise, the case is saved as a draft and can be referred later. 

Inputs 

Field 

Type 

Required 

Description 

title 

Text 

Yes 

Case title 

caseType 

Text 

Yes 

Case type code. Use List Case Types to get valid values. 

jurisdiction 

Text 

Yes 

Jurisdiction code (e.g., NY). Use List Jurisdictions to get valid values. 

clientFirstName 

Text 

Yes 

Client first name 

clientLastName 

Text 

Yes 

Client last name 

referentFirmId 

Text 

No 

If provided, immediately sends the case to this firm 

county 

Text 

No 

County name. Use List Counties to get valid values. 

clientEmail 

Text 

No 

Client email address 

clientPhone 

Text 

No 

Client phone number 

clientDateOfBirth 

Text 

No 

Format: YYYY-MM-DD 

incidentDate 

Text 

No 

Format: YYYY-MM-DD 

notes 

Text 

No 

Additional notes 

isRetainerSigned 

Boolean 

No 

Whether the client has signed a retainer 

tier 

Number 

No 

Case tier 

sentExpirationHours 

Number 

No 

Hours before the referral offer expires 

source 

Text 

No 

How the client was acquired 

salesforceId 

Text 

No 

Salesforce record ID to associate with this case 

salesforceObjectType 

Text 

No 

API name of the associated Salesforce object 

 
Outputs 

Field 

Type 

Description 

isSuccess 

Boolean 

Whether the case was created successfully 

caseDetail 

CX_SentCaseDetail 

Full details of the created case 

error 

CX_Error 

Error details if isSuccess is false 

 

Get Sent Case 

Label: Get Sent Case (CaseXchange) 

Retrieves full details for a sent case, including all referrals associated with it. 

Inputs 

Field 

Type 

Required 

Description 

id 

Text 

Yes 

CaseXchange case ID, reference number, or linked Salesforce record ID 

Outputs 

Field 

Type 

Description 

isSuccess 

Boolean 

Whether the case was retrieved successfully 

caseDetail 

CX_SentCaseDetail 

Complete case details including referrals 

error 

CX_Error 

Error details if isSuccess is false 

 

Re-Refer Sent Case 

Label: Re-refer Sent Case (CaseXchange) 

Sends or re-refers an existing case to a firm. Use this after a referral has been rejected, withdrawn, or when you want to redirect a draft case. 

Inputs 

Field 

Type 

Required 

Description 

id 

Text 

Yes 

CaseXchange case ID or reference number 

referentFirmId 

Text 

Yes 

ID of the firm to refer to. Use List Available Firms to get firm IDs. 

notes 

Text 

No 

Optional notes to include with the referral 

Outputs 

Field 

Type 

Description 

isSuccess 

Boolean 

Whether the re-referral was successful 

caseDetail 

CX_SentCaseDetail 

Updated case details 

error 

CX_Error 

Error details if isSuccess is false 

 

Update Referral Status 

Label: Update Referral Status (CaseXchange) 

Transitions a referral to a new status. Not all status transitions are valid from every current status — use Get Available Statuses first if you are unsure. 

Inputs 

Field 

Type 

Required 

Description 

id 

Text 

Yes 

Referral identifier 

status 

Text 

Yes 

Target status. Valid values: investigating, signed, in_litigation, closing, closed, rejected, withdrawn 

reason 

Text 

No 

Reason for the status change 

closingStatus 

Text 

No 

Required when transitioning to closing 

closureReason 

Text 

No 

Optional reason when transitioning to closed 

Outputs 

Field 

Type 

Description 

isSuccess 

Boolean 

Whether the status was updated successfully 

referral 

CX_Referral 

Updated referral details 

error 

CX_Error 

Error details if isSuccess is false 

 

Update Received Referral 

Label: Update Received Referral (CaseXchange) 

Updates case details on a referral your firm received. All fields except id are optional — only include fields you want to change. 

Inputs 

Field 

Type 

Required 

Description 

id 

Text 

Yes 

Referral identifier 

phase 

Text 

No 

Current phase of the case 

notes 

Text 

No 

Internal notes 

leadAttorneyName 

Text 

No 

Name of the lead attorney 

estimatedDateOfResolution 

Text 

No 

ISO 8601 date-time 

estimatedDistributionDate 

Text 

No 

ISO 8601 date-time 

statuteOfLimitationsExpiration 

Text 

No 

ISO 8601 date-time 

clientFeeAgreementPercentage 

Number 

No 

Decimal between 0.00 and 1.00 (e.g., 0.33 for 33%) 

sendingFirmPercentage 

Number 

No 

Percentage 0–100 owed to the sending firm 

projectedSettlementAmount 

Number 

No 

Projected settlement value 

settlementAmount 

Number 

No 

Actual settlement amount 

attorneyFees 

Number 

No 

Total attorney fees 

Outputs 

Field 

Type 

Description 

isSuccess 

Boolean 

Whether the update was successful 

referral 

CX_ReceivedReferralDetail 

Updated referral details 

error 

CX_Error 

Error details if isSuccess is false 

 

Send Message 

Label: Send Message (CaseXchange) 

Sends a message on a referral or case. Optionally includes a requested status change. 

Inputs 

Field 

Type 

Required 

Description 

id 

Text 

Yes 

Case or referral identifier 

message 

Text 

Yes 

Message body text 

requestedStatus 

Text 

No 

Optional status to request alongside the message 

Outputs 

Field 

Type 

Description 

isSuccess 

Boolean 

Whether the message was sent 

statusUpdate 

CX_PublicStatusUpdateDto 

Details of the sent message and any status update 

error 

CX_Error 

Error details if isSuccess is false 

 

Get Available Statuses 

Label: Get Available Statuses 

Returns the current status and list of valid status transitions for a sent case or received referral. Use this before calling Update Referral Status to confirm a transition is allowed. 

Inputs 

Field 

Type 

Required 

Description 

refId 

Text 

Yes 

CaseXchange ID of the case or referral 

isSent 

Boolean 

Yes 

true for a sent case; false for a received referral 

Outputs 

Field 

Type 

Description 

success 

Boolean 

Whether the request was successful 

currentStatus 

Text 

The case or referral's current status 

statuses 

Text Collection 

List of valid status values you can transition to 

error 

CX_Error 

Error details if success is false 

 

Evaluate Routing 

Label: Evaluate Routing (CaseXchange) 

Evaluates your routing rules for a hypothetical case profile and returns which firms would be matched. Use this to preview routing results before creating a case. 

Inputs 

Field 

Type 

Required 

Description 

caseType 

Text 

Yes 

Case type code 

jurisdiction 

Text 

Yes 

Jurisdiction code 

tier 

Number 

No 

Case tier 

county 

Text 

No 

County name 

typeCategory 

Text 

No 

Sub-category of the case type 

attempt 

Number 

No 

Routing attempt number (for round-robin or fallback logic) 

Outputs 

Field 

Type 

Description 

isSuccess 

Boolean 

Whether routing was evaluated successfully 

result 

CX_RoutingEvaluationResult 

Matched routing assignments and recommended firms 

error 

CX_Error 

Error details if isSuccess is false 

 

Evaluate Re-Referral 

Label: Evaluate Re-Referral (CaseXchange) 

Evaluates routing for an existing case to determine which firm should receive the re-referral. Returns the same routing result structure as Evaluate Routing

Inputs 

Field 

Type 

Required 

Description 

caseId 

Text 

Yes 

CaseXchange case ID, reference number, or Salesforce record ID 

tier 

Number 

No 

Override the tier for routing evaluation 

Outputs 

Field 

Type 

Description 

isSuccess 

Boolean 

Whether routing was evaluated successfully 

result 

CX_RoutingEvaluationResult 

Recommended firms for re-referral 

error 

CX_Error 

Error details if isSuccess is false 

 

List Jurisdictions 

Label: List Jurisdictions (CaseXchange) 

Returns all US states and territories supported by CaseXchange. No input required. Use the returned values to populate choice fields for the jurisdiction input on other actions. 

Outputs 

Field 

Type 

Description 

isSuccess 

Boolean 

Whether the list was retrieved successfully 

items 

CX_Jurisdiction Collection 

List of jurisdictions, each with a code and display name 

error 

CX_Error 

Error details if isSuccess is false 

 

List Case Types 

Label: List Case Types (CaseXchange) 

Returns all active case types available in CaseXchange. No input required. Use the returned values to populate choice fields for the caseType input on other actions. 

Outputs 

Field 

Type 

Description 

isSuccess 

Boolean 

Whether the list was retrieved successfully 

items 

CX_CaseType Collection 

List of active case types 

error 

CX_Error 

Error details if isSuccess is false 

 

List Counties 

Label: List Counties (CaseXchange) 

Returns counties, optionally filtered to one or more jurisdictions. Use the returned values to populate a county picker after the user selects a jurisdiction. 

Inputs 

Field 

Type 

Required 

Description 

jurisdictionCodes 

Text Collection 

No 

One or more jurisdiction codes to filter by (e.g., ["NY", "NJ"]). Omit to return all counties. 

Outputs 

Field 

Type 

Description 

isSuccess 

Boolean 

Whether the list was retrieved successfully 

items 

CX_County Collection 

List of counties 

error 

CX_Error 

Error details if isSuccess is false 

 

List Available Firms 

Label: List Available Firms (CaseXchange) 

Returns firms that can receive referrals. Supports pagination and search. Use the returned firm IDs with Create Sent Case or Re-Refer Sent Case

Inputs 

Field 

Type 

Required 

Description 

source 

Text 

No 

Filter by source: network (your referral network), directory (all CaseXchange firms), or omit for both 

search 

Text 

No 

Search term to filter firms by name 

page 

Number 

No 

Page number (default: 1) 

pageLimit 

Number 

No 

Number of results per page 

Outputs 

Field 

Type 

Description 

isSuccess 

Boolean 

Whether the list was retrieved successfully 

items 

CX_AvailableFirm Collection 

Firms matching the query 

page 

Number 

Current page number 

pageLimit 

Number 

Results per page 

total 

Number 

Total number of matching firms 

totalPages 

Number 

Total number of pages 

error 

CX_Error 

Error details if isSuccess is false 

 

List Received Referrals 

Label: List Received Referrals (CaseXchange) 

Returns referrals that have been sent to your firm. Supports filtering by status, search, pagination, and sorting. 

Inputs 

Field 

Type 

Required 

Description 

status 

Text 

No 

Filter by referral status 

search 

Text 

No 

Search term 

page 

Number 

No 

Page number (default: 1) 

pageLimit 

Number 

No 

Results per page (maximum: 200) 

sortOrder 

Text 

No 

Field to sort by 

order 

Text 

No 

Sort direction: asc or desc 

Outputs 

Field 

Type 

Description 

isSuccess 

Boolean 

Whether the list was retrieved successfully 

items 

CX_ReceivedReferralListItem Collection 

Matching referrals 

page 

Number 

Current page number 

pageLimit 

Number 

Results per page 

total 

Number 

Total matching referrals 

totalPages 

Number 

Total pages 

error 

CX_Error 

Error details if isSuccess is false 

 

Flow Templates Reference

The package includes four pre-built flow templates. Each is installed as a draft and can be activated as-is or customized before use. All flows appear under the Case Xchange category in Flow Builder. 

 

Case Xchange: Send a Case 

Type: Screen Flow 

A guided, multi-step form for creating and sending a new referral to another firm. 

What it does: 

  1. Prompts the user to select a jurisdiction, case type, and optionally a county, tier, and type category. 
  2. If routing rules are configured in CaseXchange, evaluates routing and recommends a firm. The user can accept the recommendation or request the next available option. 
  3. Collects case details: title, incident date, source, and description. 
  4. Collects client information: name, email, phone, date of birth, and notes. 
  5. Creates the case via Create Sent Case and sends it to the selected firm immediately. 
  6. On success, displays a confirmation with a link to view the case in CaseXchange. On failure, displays an error screen. 

When to use: Add this flow to a Lightning record page when users need to send cases directly from Salesforce. Can be used in place of the CaseXchangeReferral LWC. 

 

Case Xchange: Get Sent Case Info 

Type: Autolaunched Flow (Template) 

Retrieves complete information about a sent case, including the most recent referral. 

What it does: 

  1. Accepts a caseId as input. 
  2. Calls Get Sent Case to fetch full case details. 
  3. Iterates through all referrals on the case to identify the most recent one. 
  4. Returns the full case detail object and a summary of the most recent referral. 

Inputs: caseId (Text) — CaseXchange case ID, reference number, or linked Salesforce record ID. 

When to use: Call this from another flow or process when you need to display or act on the current state of a sent case. Commonly used to refresh a Salesforce record with the latest CaseXchange status. 

 

Case Xchange: Update Referral 

Type: Autolaunched Flow 

Updates the status and/or case details of a received referral in a single operation. 

What it does: 

  1. Accepts a referral ID and any combination of status and detail fields as input. 
  2. If a Status value is provided, calls Update Referral Status to transition the referral. 
  3. If any detail fields are provided (settlement amounts, dates, fee percentages, etc.), calls Update Received Referral to patch those fields. 
  4. Returns a Succesful_Update Boolean and an Error_Message string. 

Inputs 

Field 

Description 

Referral_Id 

Required. The referral identifier. 

Status 

New status value 

Status_Reason 

Reason for the status change 

Closing_Status 

Required when transitioning to closing 

Closure_Reason 

For closed transitions 

Phase 

Current case phase 

Notes 

Internal notes 

Lead_Attorney_Name 

Lead attorney 

Estimated_Date_of_Resolution 

ISO 8601 date-time 

Estimated_Distribution_Date 

ISO 8601 date-time 

Statute_Of_Limitations_Expiration 

ISO 8601 date-time 

Client_Fee_Agreement_Percentage 

Decimal 0.00–1.00 

Sending_Firm_Percentage 

Percentage 0–100 

Projected_Settlement_Amount 

Currency 

Settlement_Amount 

Currency 

Attorney_Fees 

Currency 

Outputs: Succesful_Update (Boolean), Error_Message (Text) 

When to use: Trigger from a record-triggered flow or process automation when a Salesforce record change should sync back to CaseXchange — for example, when a case stage changes or a settlement is entered. 

 

Case Xchange: Re-Refer Referral 

Type: Screen Flow 

A guided flow for withdrawing a current referral and re-sending a case to a different firm. 

What it does: 

  1. Retrieves the current case details and checks what status transitions are available. 
  2. Determines whether the case can be re-referred based on its current status: 
    1. Draft, rejected, or withdrawn: Proceeds directly to firm selection. 
    2. Active referral (can be withdrawn): Prompts the user to confirm withdrawal before re-referring. 
    3. Other statuses: Displays a message explaining the case cannot currently be re-referred. 
  3. If routing rules are configured, evaluates re-referral routing and recommends the next best firm. 
  4. Allows the user to accept the routing recommendation or search for a firm manually. 
  5. Calls Re-Refer Sent Case to send the case to the selected firm. 
  6. Displays a success or error message. 

When to use: Add this flow to a case detail page to allow users to redirect a referral when the receiving firm declines, goes unresponsive, or when the case needs to be re-assigned.