Below is my Lightning Component:
<aura:component implements="force:lightningQuickAction,force:hasRecordId"
controller="CreateActionItemController">
<aura:attribute name="recordId" type="Id" />
<aura:attribute name="event" type="Event" />
<aura:handler name="init" value="{!this}" action="{!c.doInit}"/>
<lightning:recordEditForm aura:id="editForm"
objectApiName="Action_Item__c">
<lightning:messages />
<lightning:layout multipleRows="true" class="slds-grid_align-center">
<lightning:layoutItem size="12" class="">
<lightning:inputField fieldName="Action__c"
value="{!v.event.Action__c}"
disabled="true" style="Display:None;"/>
</lightning:layoutItem>
<lightning:layoutItem size="12" class="slds-p-right_medium">
<lightning:inputField fieldName="Related_Account__c"
value="{!v.event.WhatId}" disabled="true" style="Display:None;"/>
</lightning:layoutItem>
<lightning:layoutItem size="12" class="slds-p-right_medium">
<lightning:inputField fieldName="Subject__c"
required="true" aura:id="subject"/>
</lightning:layoutItem>
<lightning:layoutItem size="12" class="slds-p-right_medium}">
<lightning:inputField fieldName="Type__c" required="true"/>
</lightning:layoutItem>
<lightning:layoutItem size="6" class="slds-p-right_medium}">
<lightning:inputField fieldName="Contact__c" />
</lightning:layoutItem>
<lightning:layoutItem size="6" class="slds-p-right_medium">
<lightning:inputField fieldName="Assigned_To__c"/>
</lightning:layoutItem>
<lightning:layoutItem size="6" class="slds-p-right_medium">
<lightning:inputField fieldName="Priority__c" required="true"/>
</lightning:layoutItem>
<lightning:layoutItem size="6" class="slds-p-right_medium">
<lightning:inputField fieldName="Status__c" required="true"/>
</lightning:layoutItem>
<lightning:layoutItem size="12" class="slds-p-right_medium">
<lightning:inputField fieldName="Due_Date__c" />
</lightning:layoutItem>
<lightning:layoutItem size="12" class="slds-p-right_medium">
<lightning:inputField fieldName="Comments__c"/>
</lightning:layoutItem>
</lightning:layout>
</lightning:recordEditForm>
<lightning:button label="Create Action Item"
class="slds-m-top--medium"
variant="brand"
onclick="{!c.clickCreate}"/>
Below is my JS Handler code for Button Click:
clickCreate : function(component, event, helper) {
component.find("editForm").submit();
$A.get("e.force:closeQuickAction").fire();
$A.get('e.force:refreshView').fire();
}
I have added Required Checks onto the fields but even so when I click on the button, its submits successfully but the out object is not created. To Solve this, I created custom validation Rule for required check. But That too are not working.
Weird things is that, when I remove the two 'Force Actions' I used in JS handler, the Validation Rules works fine.
Am I missing something here?