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
SattibabuSattibabu 

force:recordEdit is not working and throwing the below error. "Access Check Failed! Component.getEvent():'recordSave' of component 'markup://force:recordEdit {1145:0} {edit}' is not visible to 'markup://c:CW_ActivationPlanningList {376:401;a}'."

I am getting below error message whenever I try to edit and save record of custom object called ‘ Connection Point.
I have used ‘ force:recordEdit ‘ event for editing and saving the record.

User-added image

CW_ActivationPlanningList component.

User-added image

Edit modal after clicking on ‘Edit’ button from the above component.

User-added image

After clickion on save , below error message is coming
Access Check Failed! Component.getEvent():'recordSave' of component 'markup://force:recordEdit {1145:0} {edit}' is not visible to 'markup://c:CW_ActivationPlanningList {376:401;a}'.

Technical Details:
I  have defined  force:recordSave and force:recordEdit using aura:dependency inside the source component.

User-added image

Portion of code where I am opening the Modal using ‘ force:recordEdit ‘ event.  
User-added image

“editConnectionPoint” method will get called whenever  we click on Edit button from source component.
“saveEditedRecord”  method will get called after clicking on save method.
 
editConnectionPoint : function(component, event, helper) {
        var cpId = event.target.id;
        console.log('Inside Edit button click -cpId ' +cpId);
        component.set("v.showEdit",true);
        component.set("v.recordIdToEdit",cpId);
        
    },
    navigateToCpDetail : function (component, event, helper) {
        var cpId = event.target.id;
        var navEvt = $A.get("e.force:navigateToSObject");
        navEvt.setParams({
            "recordId": cpId,
            "slideDevName": "related"
        });
        navEvt.fire();
    },
    //To Save Record From Standard Edit page as modal
    saveEditedRecord : function(component, event, helper) {    
        console.log('getEvent-element' +component.find("edit"));
        console.log('inside after clicking on save button' +component.find("edit").get("e.recordSave"));
        if(component.find("edit").get("e.recordSave") !== null){        
        component.find("edit").get("e.recordSave").fire();
        }
    },

 //To confirm edited record is saved and to refresh list
    afterSaveForceEdit : function(component, event, helper) {
        console.log('inside after successful save');
        component.set("v.showEdit",false);
        var toastEvent = $A.get("e.force:showToast");
        toastEvent.setParams({
            "title": "Success!",
            "message": "The record has been updated successfully.",
            "type":"success"
        });
        toastEvent.fire();
        helper.helperInitAction(component,event,helper);
    },
  
  Note: This issus is not consistent, sometimes it's working and sometime throwing the given error. Any help would be greatly appreciated.

 
sfdcMonkey.comsfdcMonkey.com
Hi Sattibabu,
           i think here is the problem with aura:if , your <force:recordEdit> component use in aura:if part, and bydefault you have make it fase on line number 17 [aura:attribute] , try once make it true bydefault and check again.
<aura:if isTrue="false"> means tags inside aura:if have not created until it will be true 
Hopes it helps 
Thanks 
SattibabuSattibabu
Hi Piyush .. Thanks for update, i have tried your approach , but no luck. I put <aura:if>  intentionally to control the behavior of <force:recordEdit> modal pop-up.  I want to display that modal whenever i click on 'Edit' button of my source component.  If i made it true by default , force:recordEdit modal will open automatically on initialization of source component.  Interesting this is that it's working when you open source component first time, but if you reload the sournce component and click on 'Edit' button then getting this error. 

Hope below error indicating that  force:recordEdit component is not visible to source component called ' CW_ActivationPlanningList'.
Access Check Failed! Component.getEvent():'recordSave' of component 'markup://force:recordEdit {1168:0} {edit}' is not visible to 'markup://c:CW_ActivationPlanningList {376:419;a}'.
I have used aura:dependency tags inside my source component to make it visible, however it's not working.
<aura:dependency resource="markup://force:recordSave" type="EVENT"/>
 <aura:dependency resource="markup://force:recordEdit" type="COMPONENT"/>
I am not sure is there any other way to make force:recordEdit component visible to source component. 
FTrailhead LTrailheaFTrailhead LTrailhea
Seems cache issue. In `Security -> Session Settings` try to uncheck `Enable secure and persistent browser caching to improve performance`.