Skip to content

Instantly share code, notes, and snippets.

@pranayjswl007
Created April 9, 2019 12:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pranayjswl007/d0ef6305e8b4f0b084c48e74e5eb5a84 to your computer and use it in GitHub Desktop.
Save pranayjswl007/d0ef6305e8b4f0b084c48e74e5eb5a84 to your computer and use it in GitHub Desktop.
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