Custom object with quick action fails to execute force:createRecord event
Last updated 2022-02-10 ·Reference W-6872458 ·Reported By 35 users
Summary
When launching a custom quick action from a custom object with a lightning component
Which then fires the event force:createRecord will notice the event is not firing correctly and the quick action is closed unexpectedly.
ref:
https://developer.salesforce.com/docs/component-library/bundle/force:createRecord
Repro
1) Create a custom object
ie. Test_Object__c
2) Create the below Lightning component TestQuickAction
Markup
<aura:component implements="force:lightningQuickActionWithoutHeader,force:hasRecordId" access="global" >
<aura:handler name="init" value="{!this}" action="{!c.doInit}" />
</aura:component>
Controller
({
doInit : function(component, event, helper) {
var theEvent = $A.get("e.force:createRecord");
theEvent.setParams({"entityApiName":"Opportunity"});
theEvent.fire();
$A.get("e.force:closeQuickAction").fire();
}
})
3) Create a quick action on the custom object
Label : Test Action
Type: Lightning Component
Lightning Component: TestQuickAction
4) Add the action to the page layout and then navigate to the custom object
5) Click the custom Action
-Observe the event is not fired correctly and no modal is displayed from the event being fired.
Workaround
When the event is fired, should the browsers URL changed, refreshing the page with this URL
Should trigger the create record modal to be displayed
Reported By (35)


Is it Fixed?
Any unreleased services, features, statuses, or dates referenced in this or other public statements are not currently available and may not be delivered on time or at all. Customers who purchase our services should make their purchase decisions based upon features that are currently available.