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
Bryan Leaman 6Bryan Leaman 6 

Lightning Data Service error

I have a component using force:recordData components to perform updates on a selected record from a list. Everything *had* been working fine, but now I'm getting an error message I cannot explain or trace to the cause.

The scenario is that when a button is clicked, I update the recordId on my force:recordData component and call reloadRecord(). My recordUpdated handler gets called for a "LOADED" event, does nothing but log that it was called and exits.

Then I display a modal form with a handful of fields from that record. They show up with the correct values from the reloadRecord() call.

When a button is clicked I issue a saveRecord() call. My recordUpdated handler gets called for a "CHANGE" event. I hide the modal, fire a toast event and exit.

After my recordUpdated handler has completed I get a "Sorry to Interrupt" error message: "Error in $A.getCallback() [Neither a quick action or a quick action record collection. "

The root callstack entry for the exception is "dev.lightning.force.com/libraries/force/recordLibrary/crud.js:19:446"

I have console.log statements at every entry and exit point and it looks like no more of my code is running after exiting the recordUpdated handler (and nothing else *should* be running after that).

I'm at a loss how to proceed.
Bryan Leaman 6Bryan Leaman 6
Additionally, I found that the error generated in crud.js (lightning library for force:recordData) is on the line calling f(e) noted below:
crud.js 
...
   a.setCallback(this, function(a) {
                            var e = a.getState(), g;
                            if ("INCOMPLETE" === e) {
                                if (n.canCreateDraft(d)) {
                                    c.debug("record save - INCOMPLETE - " + k);
                                    n.makeDraftOfSave(k, b, d, h, !1, f);
                                    p.destroy();
                                    return
                                }
                                n.isDraftsEnabled(d) && n.draftsDisabledDueToStorageInitFailure() && (g = [{
                                    message: $A.get("$Label.SaveDraftErrors.DraftsDisabledDueToIssue")
                                }])
                            } else
                                "ERROR" === e && (g = a.getError());
                            c.debug("record save - " + e + " - " + a.getReturnValue());
                            f && (e = c._getSaveRecordResultObj(e, a.getReturnValue(), g),
                            e.action = a,
=====>               f(e));
                            p.destroy()
                        });
                        $A.enqueueAction(a)


f is recordMetricsPlugin.js and parameter e is:

action: J {Ca: iE, Kj: null, hg: {…}, background: false, C: a, …}
entityApiName: "dealer__Credit_Application__c"
entityLabel: "Credit Application"
error: undefined
recordId: "a6d540000008VgVAAU"
state: "SUCCESS"
__proto__: Object

If I try to step into recordMetricsPlugin.js it doesn't. It just jumps to the catch block in aura_prod.map.js in the AuraInstance.prototype.getCallback function.