You need to sign in to do that
Don't have an account?
Doug Kells
Separately-rendered lightning:recordForm Error
I’m running into an issue with the new lightning:recordForm component available in Summer ’18 when more than one separately-rendered component uses the same method to retrieve a different list of fields.
Basic example: Let’s say you have one component
Here’s the issue. If I put them into different tabs, only the one in the first of the tabs that is opened renders properly. When you open the second tab, the recordForm component returns an error: “This record could not be loaded because it includes too many formula fields with complex formulas….”
Has anyone else tried this? Is this expected functionality? Is there a workaround?
Basic example: Let’s say you have one component
<aura:component implements="flexipage:availableForRecordHome,force:hasRecordId,force:hasSObjectName" access="global" > <aura:attribute name="recordId" type="String" /> <aura:attribute name="fields" type="List" default="HomePhone,DoNotCall,Fax,HasOptedOutOfFax"/> <lightning:recordForm recordId="{!v.recordId}" objectApiName="Contact" fields="{!v.fields}" columns="2"/> </aura:component>Then there is an identical component with different fields:
<aura:attribute name="fields" type="List" default="Name,Phone,Email,HasOptedOutOfEmail"/>You then put these on a lightning record page for your contacts and put them within your Tabs (or Accordion) component. If both components are placed in the same tab, they both render fine when that tab becomes active.
Here’s the issue. If I put them into different tabs, only the one in the first of the tabs that is opened renders properly. When you open the second tab, the recordForm component returns an error: “This record could not be loaded because it includes too many formula fields with complex formulas….”
Has anyone else tried this? Is this expected functionality? Is there a workaround?
I have an issue with the new lightning:recordForm component when I want to edit a custom field (the system comes up with an error when I save the record)
I got this inspiration from the video
https://www.youtube.com/watch?v=KgVvidDG8do&index=25&t=0s&list=PLjJeA2SstEtK5st3FzN_vHCmviHLtY5pe
and my code is a simple one
thanks in any case
Dimtiri
<aura:component implements="flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId" access="global" >
<aura:attribute name ="recordId" type ="Id" default ="" />
<aura:attribute name ="myfields" type ="String[]"
default =
"[
'Name',
'Cost_Analysis_Status__c'
]"
/>
<lightning:card iconName="standard:contact" title="Milestones " >
<lightning:recordForm aura:id="recordViewForm"
recordId="{!v.recordId}"
objectApiName="Opportunity"
fields="{!v.myfields}"
columns ="2"
onsuccess="{!c.handleSuccess}"
/>
</lightning:card>
</aura:component>
The code that you have looks generally okay to me. Confirm that you have a method called “handleSuccess” in the component's controller. If not, this would cause an error. You may want something to happen when the save is complete, even if it just a success message. Try adding the following to the controller part of the component:
If you don't want anything like that to happen after the save, the line of code onsuccess="{!c.handleSuccess}" may be deleted.
Hope this helps.
I would like to extent it by defining dynamic the field on the component level according to the video
https://www.youtube.com/watch?v=KgVvidDG8do&index=25&t=0s&list=PLjJeA2SstEtK5st3FzN_vHCmviHLtY5pe
but when I try to use a design file i get the following error
"Failed to save OppMilestone.design: The flexipage:availableForAllPageTypes interface doesn't support these attribute types in the design resource: string[]. The flexipage:availableForRecordHome interface doesn't support these attribute types in the design resource: string[]. : Source"
As you can see in the video works perfect but I can not reproduce it.
<design:component>
<design:attribute name ="myFields" label="Field List" Description="Comma seperated list of fields" />
</design:component>
Thanks again
Dimitri
I have just modify a little bit the doInit like this: