Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ({
- changeNameToSusie: function(cmp, event, helper) {
- console.log("LDSErrorTest.handleRecordUpdated: entered");
- var contact = cmp.get("v.contactRecord");
- console.dir(contact);
- contact.FirstName = "Susie";
- cmp.set("v.contactRecord", contact);
- cmp.find("recordLoader").saveRecord($A.getCallback(function(saveResult) {
- if (saveResult.state === "SUCCESS" || saveResult.state === "DRAFT") {
- console.log("# Success" + cmp.find("recordLoader"));
- cmp.find("recordLoader").reloadRecord();
- }
- else if (saveResult.state === "INCOMPLETE") {
- console.log("User is offline, device doesn't support drafts.");
- }
- else if (saveResult.state === "ERROR") {
- console.log('Problem saving record recordLoader, error: ' +
- JSON.stringify(saveResult.error));
- cmp.set("v.returnedError", JSON.stringify(saveResult.error));
- }
- else {
- // this will fail with a message of My_Test_Formula__c: Unable to create/update fields: My_Test_Formula__c.
- //Please check the security settings of this field and verify that it is
- //read/write for your profile or permission set
- console.log('Unknown problem, state: ' + saveResult.state +
- ', error: ' + JSON.stringify(saveResult.error));
- cmp.set("v.returnedError", JSON.stringify(saveResult.error));
- }
- }));
- console.log("LDSErrorTest.handleRecordUpdated: exit");
- },
- })
Add Comment
Please, Sign In to add comment