Created
April 9, 2019 12:07
-
-
Save pranayjswl007/d0ef6305e8b4f0b084c48e74e5eb5a84 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import CONTACT_FIRSTNAME from '@salesforce/schema/Contact.FirstName'; | |
import CONTACT_LASTNAME from '@salesforce/schema/Contact.LastName'; | |
createRecord(event ){ | |
let newContact = { [CONTACT_FIRSTNAME.fieldApiName] : 'Pikachu' ,[CONTACT_LASTNAME.fieldApiName] : 'Raichu' }; | |
console.log(newContact); | |
console.log(CONTACT_FIRSTNAME); | |
createMyContact({con : newContact}).then((resp)=>{ | |
this.recordId = resp.Id; //this will auto call wireMethod/ | |
}).catch((err) => { | |
// Handle any error that occurred in any of the previous | |
// promises in the chain. | |
console.log(JSON.stringify(err)); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment