I am trying to create a quick Action that calls the flow and lightning component to create a record as suggested in the blog 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 enter image description here

And the Lightning component is like


<aura:component implements="lightning:availableForFlowActions">
  <aura:attribute name="InputContactID" type="String" />
  <aura:attribute name="InputAccountID" type="String" />


  <design:attribute name="InputContactID" />
  <design:attribute name="InputAccountID" />


 invoke : function(component, event, helper){
   var ContactID = component.get("v.InputContactID"); 
   var AccountID = component.get("v.InputAccountID"); 

   var createRecordEvent = $A.get("e.force:createRecord");

     "entityApiName": "AX_Project__c", 
     "defaultFieldValues": {
      'Contact__c' : ContactID,
       'Account__c': AccountID


When I try to click on the Quick Action on the Opportunity record I get enter image description here I tried running the flow to debug but it is also throwing Unhandled fault exception. Can anyone suggest me what I am missing here. Error in the flow

enter image description here

1 Answer 1


You might want to change the line where you are entering into createRecordEvent.setParam as follows. While you are at it also make sure that the Account__c and Contact__c (which I hope are look-ups in your case have appropriate FLS settings as well and the name, case is right. That should do the trick.

if(AccountID !="" && AccountID !=null && AccountID != undefined) // Check for ContactID also I am skipping it :-) { createRecordEvent.setParams({ "entityApiName": "AX_Project__c", "defaultFieldValues": { 'Account__c': AccountID } }); } else { createRecordEvent.setParams({ "entityApiName": "AX_Project__c" }); }

  • The record has both the Account and Contact ID's . The flow failed shows the below error Commented Jan 8, 2020 at 13:39
  • Added the screenshot the error in the question Commented Jan 8, 2020 at 13:40
  • Ok so this confirms the suspicion that the value set at record level is not getting passed from flow to component. Take out param in flow and then hard code the default values and check for the record creation in component and if that succeeds debug the flow output params...
    – Mitesh
    Commented Jan 9, 2020 at 4:17
  • Good point, you could add a debug screen at the start of your flow to make sure your recordId variable is being populated correctly. And another right before your local action to ensure everything else you're passing into the action has the value you expect. Commented Jan 10, 2020 at 18:42

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .