Save & update records in objects
Examples and code snippets
title: Opportunity Update
description: Update the opportunity Amount
type: jig.default
header:
type: component.jig-header
options:
children:
type: component.image
options:
source:
uri: https://images.unsplash.com/photo-1509228627152-72ae9ae6848d?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=1470&q=80
height: medium
datasources:
opp-amount:
type: datasource.sqlite
options:
provider: DATA_PROVIDER_LOCAL
entities:
- entity: Opportunity
query: SELECT id, '$.Name', '$.Amount' FROM [Opportunity] WHERE id = @id
queryParameters:
id: =@ctx.jig.inputs.id
children:
- type: component.form
instanceId: opp-form
options:
children:
- type: component.text-field
instanceId: id
options:
initialValue: =@ctx.jig.inputs.id
isHidden: true
label: id
- type: component.text-field
instanceId: Name
options:
label: Opportunity Name
initialValue: =@ctx.datasources.opp-amount.Name
- type: component.number-field
instanceId: Amount
options:
label: Amount
initialValue: =@ctx.datasources.opp-amount.Amount
actions:
- children:
- type: action.submit-form
options:
title: Update Amount
provider: DATA_PROVIDER_SALESFORCE
entity: Opportunity
formId: opp-form
method: save
data:
id: =@ctx.components.id.state.value
Amount: =@ctx.components.Amount.state.value
onSuccess:
type: action.go-back Last updated
Was this helpful?