List records in objects
Reading data from Salesforce using the Salesforce provider is easy. The provider is intuitive, and once you have synced the data from the Salesforce provider to the local data provider, you can design lists, charts, and widgets to show your organization's Salesforce metrics, accounts, opportunities, and more.
Examples and code snippets
Examples are based on test data in a Jigx demo Salesforce environment. Copying the sample code must be adjusted to represent your own Salesforce environment.
List of accounts
The code below shows a simple example of a list of accounts in Salesforce. Adding search and filter properties allows you to easily find the accounts you looking for.
title: List Salesforce accounts
type: jig.default
header:
type: component.jig-header
options:
height: medium
children:
type: component.image
options:
source:
uri: https://images.unsplash.com/photo-1605152276897-4f618f831968?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=2670&q=80
onFocus:
type: action.action-list
options:
actions:
- type: action.sync-entities
options:
provider: DATA_PROVIDER_SALESFORCE
entities:
- Account
datasources:
salesforce-accounts:
type: datasource.sqlite
options:
provider: DATA_PROVIDER_LOCAL
entities:
- entity: Account
query: SELECT id, '$.Name', '$.Type', '$.BillingCountry' FROM [Account] WHERE ('$.Type' LIKE @filter OR @filter IS NULL) AND ('$.Name' LIKE '%'||@search||'%' OR @search IS NULL)
queryParameters:
filter: =@ctx.components.account-list.state.filter
search: =@ctx.components.account-list.state.searchText
children:
- type: component.list
instanceId: account-list
options:
data: =@ctx.datasources.salesforce-accounts
isSearchable: true
maximumItemsToRender: 50
filter:
- title: All
value: ""
- title: Prospect
value: Prospect
- title: Customer - Direct
value: Customer - Direct
item:
type: component.list-item
options:
title: =@ctx.current.item.Name
subtitle: =@ctx.current.item.BillingCountry
label:
title: =@ctx.current.item.Type
leftElement:
element: avatar
text: SF
List of Opportunities
The code below shows a basic example of a list of opportunities in Salesforce with an onPress action that will allow you to update the opportunity amount.
Create a Stage detail jig
Below is an example of reading data from the Account, Opportunity, and OpportunityStage objects in Salesforce. Combining the data, using a jig.list with component.list-item and component.summary to create the Stage Detail jig.
Last updated
Was this helpful?