4

HTML

<template> <lightning-record-edit-form object-api-name="Contact" onsuccess={handleSuccess}> <lightning-messages></lightning-messages> <div class="slds-m-around_medium"> <lightning-input-field field-name='Id' value={contactId}></lightning-input-field> <lightning-input-field field-name='LastName'></lightning-input-field> <lightning-input-field field-name='FirstName'></lightning-input-field> <lightning-input-field field-name='Email'></lightning-input-field> <lightning-input-field field-name='AccountId'></lightning-input-field> <div class="slds-m-top_medium"> <lightning-button variant="brand" type="submit" name="save" label="Create Contact"> </lightning-button> </div> </div> </lightning-record-edit-form> 

JS

import { LightningElement, api,track } from 'lwc'; export default class app extends LightningElement { @track contactId; handleSuccess(event) { this.contactId = event.detail.id; } } 

Am getting following error when i ran the above code in Salesforce Play Ground. Since am new to salesforce, Can some one help me on this. Thank you

enter image description here

1 Answer 1

6

Playground does not support components like lightning-record-edit-form or any other base components that requires a Salesforce connection.

You will need to use an IDE like vscode extension for Salesforce and Salesforce CLI to connect your local machine to actual Salesforce org to verify and play with components that require Salesforce UI API or Salesforce metadata API or Salesforce data.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.