Skip to main content

Hi Everyone, 

 

We have developed an LWC for View Account Record for Salesforce Offline Mobile and inside that LWC, we have given a button to basically create a record of Another Object. When we click on that button, a lightning-record-edit-form is displayed and inside that form, there are many lightning-input fields where the user can enter values to create record. 

 

Inside the lightning-record-edit-form, we are doing conditional rendering i.e based on the value that the user enters in a lightning-input picklist, we are displaying certain lightning-input fields. 

 

Now this whole thing is working smooth as butter when the App is in online mode. But when I go offline, i am getting certain errors. These errors are not persistent but occur randomly. What I am guessing is, after the records are synced, if we do a complete run through of the LWC in online mode, then it seems to work fine in offline but as I mentioned this is not the only scenario. 

 

So for some reason, LWC priming is not happening correctly because Records are getting synced and I am able to access them, So there must be some issue with the LWC but I'm unable to pin-point the issue. 

 

I have checked all the things like Briefcase Builder, Access to all the fields, Quick Actions etc and everything is done as per the Salesforce Mobile Offline documentation. 

 

Some Help here will be highly Appreciated ! 

 

Please Note:- For the Second Screenshot, The Error reads as 

"type: unspecified, message: /services/data/v63.0/ui-api/record-defaults/create/Object__c could not be reached"

1 件の回答
  1. 2025年8月6日 14:52

    Although I don't know the details of this LWC's implementation, it's possible the conditional rendering could be the source of the problem, if any component (custom or standard) both 

    1. Is conditionally constructed AND 

    2. Includes @wire of any data that needs to be primed 

     

    The Komaci static analyzer for priming does not follow anything dependent upon @track / runtime variables. If any data *may* be needed based on runtime conditions, it can't be behind any runtime conditions. 

     

    Likely, when your user runs through those conditions while online, it is filling the cache with data that was *not* primed initially, making things work after going offline.

0/9000