You need to sign in to do that
Don't have an account?
MUSFAR KT 6
how to use field set in lightning component for form edit and view
how to use fieldset in lightning component for creation of form edit and view in the account object
function readOnly(count){ }
You need to sign in to do that
Don't have an account?
Please refer below link which might help you in this
https://superqbit.com/2019/08/08/dynamic-lightning-record-edit-form-using-field-sets/
https://www.sfdcpanther.com/how-to-use-field-set-in-lightning-component/
https://metillium.com/2018/02/lightning-field-set-form-component-v2/
Hope this helps you
Let me know if this helps you. Kindly mark it as solved so that it may help others in future.
Thanks and Regards
This link is "https://superqbit.com/2019/08/08/dynamic-lightning-record-edit-form-using-field-sets/" very helpful.
I tried another method but it showing all sections in this form. actually, I need Account information section only in this form.how will I achieve this scenario any idea? I mentioned my code below
<aura:component implements="flexipage:availableForAllPageTypes,force:appHostable,flexipage:availableForRecordHome,force:hasRecordId,force:hasSObjectName" access="global" >
<aura:attribute name="sObjectName" type="String" default="Pet__c" />
<lightning:card iconName="custom:custom19" title="lightning:recordForm">
<div class="slds-p-left_large slds-p-right_medium">
<lightning:recordForm aura:id="recordViewForm"
objectApiName="Account"
fields="Name,AccountNumber,Type,Industry,Phone,City"
columns="2"
layoutType ="Full"
mode="edit"
onsuccess="{!c.onSuccess}"
onsubmit="{!c.onSubmit}"
onload="{!c.onLoad}"
onerror="{!c.onError}"
/>
</div>
</lightning:card>
<lightning:card iconName="custom:custom19" title="Edit lightning:recordForm">
<div class="slds-p-left_large slds-p-right_medium">
<lightning:recordForm aura:id="recordViewForm"
objectApiName="Account"
columns="2"
fields="Name,AccountNumber,Type,Industry,Phone,City"
recordId="0016F00003d15i1"
layoutType ="Full"
mode="View"
onsuccess="{!c.onSuccess}"
onsubmit="{!c.onSubmit}"
onload="{!c.onLoad}"
onerror="{!c.onError}"
/>
</div>
</lightning:card>
<lightning:card iconName="custom:custom19" title="Read Only lightning:recordForm">
<div class="slds-p-left_large slds-p-right_medium">
<lightning:recordForm aura:id="recordViewForm"
objectApiName="Account"
columns="2"
fields="Name,AccountNumber,Type,Industry,Phone,City"
recordId="0016F00003d15i1"
layoutType ="Full"
mode="readonly"
onsuccess="{!c.onSuccess}"
onsubmit="{!c.onSubmit}"
onload="{!c.onLoad}"
onerror="{!c.onError}"
/>
</div>
</lightning:card>
</aura:component>
({
onSuccess : function(component, event, helper) {
var toastEvent = $A.get("e.force:showToast");
toastEvent.setParams({
"title": "Success!",
"message": "The record has been Saved successfully."
});
toastEvent.fire();
},
onSubmit : function(component, event, helper) {
},
onLoad : function(component, event, helper) {
var toastEvent = $A.get("e.force:showToast");
toastEvent.setParams({
"title": "Loaded!",
"message": "The record has been Loaded successfully ."
});
toastEvent.fire();
},
onError : function(component, event, helper) {
var toastEvent = $A.get("e.force:showToast");
toastEvent.setParams({
"title": "Error!",
"message": "Error."
});
toastEvent.fire();
}
})