Overview
...
Salesforce
Save & update records in objects
2 min
there is always a need to ensure records are kept up to date and have the latest contact details, sales figures, or case details the salesforce save or update methods allow you to update records in salesforce directly from your mobile device 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 this example shows how to update a salesforce opportunity record from the list of opportunities using the onpress action the jig opens a form showing the opportunity name and amount edit the amount field using the salesforce providers save method the opportunity is updated salesforce opp update jigx 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 salesforce opp list jigx title list salesforce opportunities type jig default header type component jig header options height medium children type component image options source uri https //images unsplash com/photo 1454165804606 c3d57bc86b40?ixlib=rb 4 0 3\&ixid=m3wxmja3fdb8mhxwag90by1wywdlfhx8fgvufdb8fhx8fa%3d%3d\&auto=format\&fit=crop\&w=1170\&q=80 onfocus type action action list options actions \ type action sync entities options provider data provider salesforce entities \ entity opportunity datasources salesforce opp list type datasource sqlite options provider data provider local entities \ entity opportunity query select id, '$ name', '$ amount' from \[opportunity] children \ type component list instanceid account list options data =@ctx datasources salesforce opp list item type component list item options title =@ctx current item name leftelement element avatar text sf rightelement element value text format currency usd numberstyle currency text =@ctx current item amount onpress type action go to options linkto salesforce opp update inputs id =@ctx current item id entity opportunity