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
akkkakkk 

I am getting Error when are inserting the Recrod in task object with lightning Component ??

Hi all

I am getting the Error when am i inserting the Record in the Task Object but same i am ok with the Account Object and Contact Object. but facing the Error with Task Object

Component =>
<aura:component implements="flexipage:availableForRecordHome,force:hasRecordId">
    <lightning:recordEditForm recordId="{!v.recordId}" objectApiName="Task" onsuccess ="{!c.onSuceesssAction}">
                <div class="slds-box">
                    <!--showing the records -->
                            <lightning:card title="New Task" iconName="standard:task">
                                    <lightning:inputField fieldName="Description"/>
                                    <lightning:inputField fieldName="ActivityDate"/>
                                    <lightning:inputField fieldName="Priority"/>
                                     <lightning:inputField fieldName="Status"/>
                                    <lightning:inputField fieldName="Subject"/>
                            
                            <!--for save records after edit -->
                                <aura:set attribute="actions">
                                    <lightning:button label="Save" type="Submit"/>
                                </aura:set>
                           </lightning:card>      
                 </div>
                    
    </lightning:recordEditForm>
</aura:component>
component js =>
({
    onSuceesssAction : function(component, event, helper) {
        alert('Record has been Updated successfully !!');
    
        
    }
})



Thanks
akhan25
Danish HodaDanish Hoda
Hi there,
The issue is with this part recordId="{!v.recordId}"
Perhaps, you are not having a dedicated page for task where you are using this component.
akkkakkk
just i am using this compoent for the Task object all reday decleared     <lightning:recordEditForm recordId="{!v.recordId}" objectApiName="Task" onsuccess ="{!c.onSuceesssAction}">
akkkakkk
Hi Danlsh Hoda
its not the answer of the question because all ready work that component with Account object but not working with Task Object.

Thanks
akhan25
Danish HodaDanish Hoda
Hi Aklim,You are right, recordEditForm doesn't support some objects like Task, Event.