Last active
November 14, 2019 12:05
-
-
Save Sunil02kumar/ec5aed3ff3ec4a46f4e833d59c6f17ed to your computer and use it in GitHub Desktop.
Pre-populate Field Values on Standard Pages in Lightning
This file contains hidden or 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
<aura:component implements="force:appHostable,flexipage:availableForRecordHome,force:hasRecordId" > | |
<lightning:button name="Create Quick Contact" label="Create Quick Contact" onclick="{!c.createQuickContact}"/> | |
</aura:component> |
This file contains hidden or 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
({ | |
createQuickContact : function(component, event, helper) { | |
var createAcountContactEvent = $A.get("e.force:createRecord"); | |
var accid=component.get("v.recordId"); | |
console.log('accid-'+accid); | |
createAcountContactEvent.setParams({ | |
"entityApiName": "Contact", | |
"recordTypeId":'0120I000000nhJFQAY', | |
"defaultFieldValues": { | |
'Phone' : '415-240-6590', | |
'AccountId' : accid, | |
'Email':'[email protected]' | |
} | |
}); | |
createAcountContactEvent.fire(); | |
} | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment