1

Does anyone know if there are known bugs with using record-edit-form on a local development server? The record loads just fine in the org but doesn't seem to load when attempting to load it from the local development server. I noticed that the onload function never seems to fire and that the onerror function doesn't fire either.

    <lightning-record-edit-form object-api-name="Case" record-type-id={recordTypeId} onload={handleRecordLoaded} onsubmit={handleSubmit} onerror={handleError} onsuccess={handleSuccess}>
      ...
    </lightning-record-edit-form>

2 Answers 2

1

I ran into this same problem running the basic example code for "Creating a Record" in the record-edit-form component reference documentation.

I was able to fix my issue with that specific example by adding the lightning__Tab target to my js-meta.xml file, so that it looked like this:

<?xml version="1.0" encoding="UTF-8" ?>
<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata">
  <apiVersion>47.0</apiVersion>
  <isExposed>false</isExposed>
  <targets>
    <target>lightning__Tab</target>
  </targets>
</LightningComponentBundle>

Still unsure how the server works, so can't provide any magic insight. Just the result of my tinkering... so please let me know if that solves your issue!

0

While developing in the Local Development Server, try hard-coding variables like recordId. The problem is the Local Development Server doesn't know how to get a record context.

It'd be nice if devs could have a way to inject FlexiPage context, e.g. through a URL parameter, but alas, this isn't supported today.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .