Skip to content

Instantly share code, notes, and snippets.

@sbob-sfdc
Created September 5, 2012 20:50
Show Gist options
  • Save sbob-sfdc/3644520 to your computer and use it in GitHub Desktop.
Save sbob-sfdc/3644520 to your computer and use it in GitHub Desktop.
Workshop 302, Tutorial 3, Step 2
// handle clicks to Update on detailpage
$j("#updateButton").click(function() {
// update local information in the inventory array
inventory[$j("#detailpage").attr("data-id")].Quantity__c = $j("#quantity").val();
currentRecord = inventory[$j("#detailpage").attr("data-id")];
// strip out ID before updating the database
var data = new Object();
data.Quantity__c = currentRecord.Quantity__c;
// update the database
forcetkClient.update("Merchandise__c",currentRecord.Id,data,updateSuccess,onErrorSfdc);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment