6

We are working on a modal which allows the user to edit Task as well as Event record from a grid view. We are using lightning:recordEditForm to show record edit view but for some reason, all we get is blank white screen in the modal.

We tried to use lightning:recordEditForm to edit record for a custom object record also for some standard object such as Account, Contact.. it works fine.

As a matter of fact, I believe that lightning:recordEditForm uses Lightning Data Service internally, so looking at its current limitation it does not support Task and Event.

Not sure if my assumption is right? or Has anyone experienced this issue?

NOTE : We are trying to show the modal in LEX

  • Your assumption seems to be right. If you have Task in recordEditForm, you get to see an error as -- Error in fetching record or record metadata. [Object Task is not supported in UI API] – Jayant Das Apr 20 '18 at 12:46
  • @JayantDas Where exactly you get this error? I don't see any error log in the browser console in LEX – Praveen Apr 20 '18 at 13:09
  • I created a dummy app and used Task/Event in that to see if that works, and it returned this error right on the UI when the app loaded. – Jayant Das Apr 20 '18 at 13:11
  • I added the sample code and screenshot in answer, if that helps to visualize the error. – Jayant Das Apr 20 '18 at 14:29
6

Your assumption seems to be right. Tried this in a quick app and could see that the error message returned specifies the object (Task or Event) not to be supported.

Below is the sample code and the error on UI.

Code:

<aura:application extends="force:slds" controller="TestBed">
<lightning:recordEditForm aura:id="editForm" objectApiName="Task" >
    <lightning:messages />
    <lightning:inputField aura:id="email" fieldName="Email" />
    <lightning:button class="slds-m-top_small" variant="brand" name="update" label="Update" onclick="{!c.onSubmit}"/>
</lightning:recordEditForm>

Error when the app loaded: enter image description here

0

For editing an existing record, you can use "force:editRecord"

editRecord : function(component, event, helper) 
var editRecordEvent = $A.get("e.force:editRecord");
editRecordEvent.setParams({
  "recordId": component.get("v.YOUR_SOBJECT_RECORD_ID")
});
    editRecordEvent.fire();
}
  • No, I don't want to use force event as it navigates to the detail page. I needed to stay in the page the modal is opened and access the record id after record creation. – Praveen Apr 22 '18 at 12:59
  • You won‘t be navigated, you will stay on the same Page where you are, and a modal window will just be opened. – Mo Hamada Apr 22 '18 at 13:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.