I have a lightning Component to display the Account and its Contact relationship in tree view using Accordion SLDS. On this page, I want to put "New Contact" button to create a contact record.
Is it possible to get the standard lightning experience popup to create a record from New button on lightning component?
I tried the below one, but no luck,
<ui:button label="New" press="{!c.createRecord}"/>
Controller
({
createRecord : function (component, event, helper) {
var createRecordEvent = $A.get("e.force:createRecord");
createRecordEvent.setParams({
"entityApiName": "Contact"
});
createRecordEvent.fire();
}
})
getting error:
$createRecord [Cannot read property 'setParams' of undefined]
Is there any way out there to get the standard lightning experience record creation page layout by clicking the New button in lightning component?.
Thanks in advance!