Questions tagged [lightning-record-form]

A lightning:recordForm component enables you to quickly create forms to add, view, or update a record. Using this component to create record forms is easier than building forms manually with lightning:recordEditForm and lightning:recordViewForm.

Filter by
Sorted by
Tagged with
12
votes
5answers
4k views

Pre-populate field values in lightning:recordForm onload

I'm using lightning:recordForm to display create view for a custom sObject. It works as expected, but I cannot find a way to pre-populate some of the fields for create view, e.g. lookups. ...
8
votes
1answer
1k views

Show form with page layouts && intercept save … Lightning:recordForm / force:recordData

Somewhat flummoxed with this lightning component. The use case is simple: Intercept the save event on a record edit, grab the new field values and do 'stuff' before saving the record. Example User ...
8
votes
2answers
3k views

Issue with error messages on Lighting:recordform

There seems to be an issue with the error handling on lightning:recordForm, and some real limitations on lightning:recordEditForm. Trying to determine if this is a bug or a mistake on my part. ...
6
votes
1answer
2k views

Lightning:recordForm cancel button unresponsive

I'm building out some community features and one of them is like a related list with a new button. When the user presses the new button, I am launching a modal window with another custom component ...
6
votes
3answers
983 views

Lightning recordForm displaying stale data

After two days I'm out of ideas and hoping someone here could offer suggestions or even better -- tell me where I'm being silly! I am trying to refresh the view of the child (recordForm) but it is ...
5
votes
2answers
3k views

Standard cancel button in lightning:recordform not closing the quick action dialogue

I am creating a lightning component which shows opportunity in edit mode using lightning:recordform tag(summer 18 salesforce release). Now when I am clicking on cancel button it should close the quick ...
5
votes
2answers
1k views

lightning:recordForm with lookup to Account Object does not work - Bug Identified (I believe)

Final update See my answer below for the issues. I believe there is a bug in the implementation as well. The lookup will not work if the field is not on the page layout configuration. The weird ...
5
votes
2answers
98 views

Detect lightning:recordForm change in mode attribute

I'm trying to disable some surrounding components based on the mode attribute within lightning:recordForm (i.e. anytime I'm in edit mode, I'd like to disable a lightning:buttonMenu that sits just ...
5
votes
2answers
554 views

lightning:recordForm - Error when layout contains recordTypeId

I have a component that contains lightning:recordForm like so: <lightning:recordForm recordId="001f200001Zg2uYAAR" objectApiName="Account" layoutType="...
4
votes
2answers
450 views

Specify read only fields for lightning:recordForm

On the Case object, I have a lightning component that displays only the fields of interest depending on the Status of the case. I have a separate Change_Status_To__c dependent picklist that actually ...
4
votes
1answer
129 views

How can I dynamically assign a value to a lightning record form?

For example, my component has the following section that displays a record form: <template if:true={showRecordForm}> <lightning-record-form object-api-name={sObjectApiName} ...
4
votes
1answer
757 views

Refreshing issues in lightning:recordViewForm

I'm having TestObject as parent object and New Custom Object having M-D relationship to it. TestObject having Min and Max Rollup summary fields which will rollup number field in child object. I was ...
4
votes
0answers
563 views

Detecting Data Changes with lightning:recordform

how can one bind onchange event handlers to the fields of the lightning:recordform component? component.cmp <aura:attribute name="fieldsArray" type="String[]" default="['Subject','...
3
votes
1answer
2k views

Lightning:recordForm onload() method to prepopulate fields on record creation

I am using lightning:recordForm to create a record creation form. I am trying to pre-populate some fields. My component: <aura:component description="replaceDuplicatesModal" controller="...
2
votes
1answer
296 views

Is lightning:recordForm is supporting for custom settings?

I need to create a lightning component to Edit a particular Custom settings Record using the lightning:recordForm. But I couldn't able to achieve it and got the following error. I will share my code ...
2
votes
1answer
1k views

lightning:recordForm does not display fields

I'm having trouble using the new lightning:recordForm component. Here is my code : <aura:attribute name="fieldsArray" type="String[]" default="['Name','Email','Phone','AccountId']" />...
2
votes
0answers
51 views

LWC: Master-detail field default value in Lightning-record-form

Is there a way to assign default value for record's master-detail field on LWC component "lightning-record-form" ?
1
vote
2answers
970 views

How to use Lightning-Record-Form onError to display custom error message

Let's say I have a Lightning-Web-Component that uses lightning-record-form like this: <lightning-record-form record-id={recordId} object-api-name="Opportunity" fields={myFields} ...
1
vote
1answer
72 views

What impact have on performance of page loading when we use multiple Lightning:RecordForm in a single component

We are using multiple lightning:recordForm in different aura:if for the different condition in a single custom Lightning Component for showing different field. Is it the best practice to use ...
1
vote
1answer
172 views

Lightning:recordForm custom buttons

Is it possible to include custom buttons on Lightning:RecordForm or any of its variations ? Specifically a "save and new" button. If this is not possible, should the alternative be to create a ...
1
vote
1answer
62 views

Merging multiple Field Sets to use only one general Save and Cancel Button using <lightning:recordForm>

I'm building a Lightning component page using multiple Field Sets which using tag so that every section has its own Save and Cancel button. I wanna make it simple and comfortable for the users so ...
1
vote
0answers
105 views

Lightning RecordEditForm - getting error [object object] for few users

Problem: Many users are able to see a form but few users are not able to see the form and getting error [object object]. I am using lightning:recordEditForm as below in lightning record page: <...
1
vote
0answers
18 views

recordForm error Handling

I have a recordForm like this:- <aura:attribute name="KeyDealInfoSectionfieldlist" type="String[]" default="field1__c,field2__c"/> <aura:attribute name="objectName" type="String" ...
1
vote
0answers
129 views

LWC record form for related fields

MY LWC looks like below import { LightningElement,api } from 'lwc'; import ENGAGE_SUBJECT_FIELD from '@salesforce/schema/Engagement__c.Subject__c'; import ENGAGE_INDUSTRY_GROUP_FIELD from '@...
1
vote
0answers
30 views

Lightning:recordForm is not displaying fields as mandatory but the fields are marked as mandatory on Pagelayout

I have multiple recordTypes and multiple pagelayouts. For each record type there are specific fields marked as mandatory as per the recordType on the pagelayout but when i am using lightning:...
1
vote
0answers
115 views

Lightning:recordForm onSuccess event not returning response

I'm trying to get the response in the onSuccess callback for a lightning:recordForm save event, but it's coming up as undefined. The callback is being called, I can log to the console, but both of the ...
1
vote
0answers
184 views

lightning:recordForm - New Record doesn't render Compact

I have a lightning recordForm defined as: <lightning:recordForm objectApiName="Account" layoutType="Compact" columns="3" ...
1
vote
1answer
155 views

LightingInput for Address not setting default Country Code

I am using the new Lightning:recordForm with a list of fields. <lightning:recordForm objectApiName="Account" recordTypeId ="{!v.rtTypeId}" fields="{!v.acctFields}" ...
0
votes
1answer
299 views

Lightning:recordForm 's onSuccess doesn't return record ID [duplicate]

I am using the lightning:recordForm for creating the record <lightning:recordForm aura:id="recordViewForm" objectApiName="{!v.sObjectName}" ...
0
votes
1answer
182 views

What's the easiest way to write a properly working onChange handler for lightning:recordForm? [closed]

It is more question for Salesforce gurus and Lightning/Aura Components Framework developers. On my own, Lightning Framework has a lot of restrictions and sometimes it is really hard to build flexible ...
0
votes
1answer
2k views

Preset a few fields in lightning:recordForm component

Is it possible to preset a few fields in lightning:recordForm component? For example, I have an object which has a master-detail field. And now I would like to have my lightning:recordForm being ...
0
votes
1answer
234 views

ONSUCCESS event doesn't fire on dynamically created recordForm component

I'm trying to get the saved data from my recordForm component handling the onsuccess event but the controller's function handling the event is not triggered. I think this happens because my component ...
0
votes
1answer
69 views

How to override Save button and show the popup in lightning-record-form of LWC [closed]

I have the requirement to show a WARNING POPUP / confirmation box when user click on save button in Record form of Lightning Web Components(LWC). Can i override save button and display confirm popup ...
0
votes
1answer
127 views

lightning:recordForm not displaying full error message

I am getting only the below generic error message in lightning:recordForm component. An error occurred while trying to update the record. Please try again. But I see the below error in the onerror ...
0
votes
2answers
80 views

LWC Composition for Custom Layout inside a lightning-record-form

I have a SObject with multiple display layouts. Now, I want a way to display a particular layout in my lightning-record-form with different lightning-input-field. I don't wanna attach all the fields ...
0
votes
1answer
106 views

onLoad not been called in lightning:recordEditForm

I am having input fields inside my recordEditForm. When i try to run the component it's not calling the onload event handler. I don't want to put any lightning:inputField into it. Because I don't need ...
0
votes
1answer
46 views

Add look up field in lightning-record-form with on lightning web component

I want to know if there is a way to add look up field in lightning-record-form with on lightning web component. Thanks in advance.
0
votes
0answers
23 views

Can I assign fields to a record in a recordForm component using JavaScript? [duplicate]

Is it possible to assign a field to a record loaded with the component lightning:recordForm? Like: component.find('myform').set('v.record.Field__c', 'We were hereeee!')
0
votes
3answers
40 views

Fields required at layout level are not required in lightning-record-form lwc

I am trying to create a new button for a Custom object to add it in community.On clicking the button lightning-record-form will be displayed in edit mode to show input fields of the layout but what ...
-1
votes
2answers
37 views

lightning-input-field not showing correctly for time (Lightning Web Components) [duplicate]

This happens both with the lightning-record-form, and using lightning-record-edit-form when defining a field with lightning-input-field with a "time" field. Instead of showing a dropdown list to pick ...