function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
D VelD Vel 

Quick Action and flow to create a record in lightning

I am trying to create a quick Action that calls the flow and lightning component to create a record as suggested in the blog (https://thewizardnews.com/2018/08/02/url-hack-functionality-lightning/) here. I need to create a record of custom object from Opportunity record , using the Quick action as suggested in the blog. I created a flow like below with the Action which calls the lightning component createAXProjectRecords 
User-added image
And the Lightning component is like
createAXProjectRecords.cmp
<aura:component implements="lightning:availableForFlowActions"> <aura:attribute name="InputContactID" type="String" /> <aura:attribute name="InputAccountID" type="String" /> </aura:component>
createAXProjectRecords.design
<design:component> <design:attribute name="InputContactID" /> <design:attribute name="InputAccountID" /> </design:component>
createAXProjectRecordsController.js
({ invoke : function(component, event, helper){ var ContactID = component.get("v.InputContactID"); var AccountID = component.get("v.InputAccountID"); var createRecordEvent = $A.get("e.force:createRecord"); createRecordEvent.setParams({ "entityApiName": "AX_Project__c", "defaultFieldValues": { 'Contact__c' : ContactID, 'Account__c': AccountID } }); createRecordEvent.fire(); } })
When I try to click on the Quick Action on the Opportunity record I get  
User-added image
Can anyone please suggest me what I am missing here.
Jithin U NairJithin U Nair
Hi,

Please check that none of the field values assigned via .setParams() are null. In your case please check for the ContactID and AccountID values.