Create records in objects
Last updated
Was this helpful?
Was this helpful?
title: Create Salesforce account
description: 2 Create a new account in Salesforce
type: jig.default
header:
type: component.jig-header
options:
height: medium
children:
type: component.image
options:
source:
uri: https://images.unsplash.com/photo-1450101499163-c8848c66ca85?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=1470&q=80
onFocus:
type: action.action-list
options:
actions:
- type: action.sync-entities
options:
provider: DATA_PROVIDER_SALESFORCE
entities:
- Account
datasources:
salesforce-acc-type:
type: datasource.sqlite
options:
provider: DATA_PROVIDER_LOCAL
entities:
- entity: Account
query: SELECT '$.Type' FROM [Account]
children:
- type: component.form
instanceId: new-account
options:
children:
- type: component.text-field
instanceId: Name
options:
label: Account Name
- type: component.dropdown
instanceId: Type
options:
label: Account Type
data: =$distinct(@ctx.datasources.salesforce-acc-type)
item:
type: component.dropdown-item
options:
title: =@ctx.current.item.Type
value: =@ctx.current.item.Type
- type: component.text-field
instanceId: BillingCountry
options:
label: Billing Country
- type: component.text-field
instanceId: BillingState
options:
label: Billing State
- type: component.text-field
instanceId: Phone
options:
label: Phone
actions:
- children:
- type: action.action-list
options:
title: Submit
isSequential: true
actions:
- type: action.submit-form
options:
formId: new-account
provider: DATA_PROVIDER_SALESFORCE
method: create
entity: Account
onSuccess:
title: Successfully created
- type: action.go-backtitle: Create Salesforce opportunity
description: Create a new opportunity in Salesforce
type: jig.default
header:
type: component.jig-header
options:
height: medium
children:
type: component.image
options:
source:
uri: https://images.unsplash.com/photo-1606189934732-1c274f894bf9?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=1470&q=80
onFocus:
type: action.action-list
options:
actions:
- type: action.sync-entities
options:
provider: DATA_PROVIDER_SALESFORCE
entities:
- Opportunity
datasources:
salesforce-opp:
type: datasource.sqlite
options:
provider: DATA_PROVIDER_LOCAL
entities:
- Opportunity
query: SELECT id, '$.StageName', '$.Type' FROM [Opportunity]
children:
- type: component.form
instanceId: new-opportunity
options:
children:
- type: component.text-field
instanceId: Name
options:
label: Opportunity Name
- type: component.dropdown
instanceId: StageName
options:
label: Stage
data: =@ctx.datasources.salesforce-opp
item:
type: component.dropdown-item
options:
title: =@ctx.current.item.StageName
value: =@ctx.current.item.StageName
- type: component.dropdown
instanceId: Type
options:
label: Opportunity Type
data: =@ctx.datasources.salesforce-opp
item:
type: component.dropdown-item
options:
title: =@ctx.current.item.Type
value: =@ctx.current.item.Type
- type: component.date-picker
instanceId: CloseDate
options:
label: Select a close date
format: L
actions:
- children:
- type: action.action-list
options:
title: Submit
isSequential: true
actions:
- type: action.submit-form
options:
formId: new-opportunity
provider: DATA_PROVIDER_SALESFORCE
method: create
entity: Opportunity
onSuccess:
title: Successfully created
- type: action.go-back