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
Sachin30Sachin30 

e.force.EditRecord causing a loop

I have two lightning components. One for create new record and other one for edit record. I am overriding the standard new and edit actions with these components. 

The new action is working fine and user is getting redirected to CreateComponent which is firing standard e.force:CreateRecord event and the form shows up correctly.

However when I am trying to edit the record it is being redirected to EditComponent but then the browser hangs. On debugging I found that it is causing an infinite loop because of the standard e.force:EditRecord event being called in js controller for the component which seems to be logically correct.

But my question is why it is not behaving the same for CreateComponent. What is the difference between the two? or Am I missing something here?
Hao Huang 8Hao Huang 8
Hi Sachin,

I am facing the same issue, have you found a solution yet ?