You need to sign in to do that
Don't have an account?
Mishu Bhat
Hide a field based on a picklist value in lightning component
Hi,
I want to show the 'SuppliedEmail' field on the form when the picklist value of 'Investigation_Email_Preference__c' is either "abc" or "def".
How do i do that with lightning:recordForm ?
Component:
<aura:component implements="flexipage:availableForAllPageTypes,force:lightningQuickActionWithoutHeader,force:hasRecordId">
<aura:attribute name="myFields" type="List" default="['Case_Investigation__c','Investigation_Subject__c','Investigation_Email_Preference__c','Tier2_Agent__c','SuppliedEmail']"/>
<lightning:recordForm
recordId="{!v.recordId}"
objectApiName="Case"
columns="2"
fields="{!v.myFields}"
mode="edit"
onsubmit="{!c.handleSubmit}"/>
</aura:component>
I want to show the 'SuppliedEmail' field on the form when the picklist value of 'Investigation_Email_Preference__c' is either "abc" or "def".
How do i do that with lightning:recordForm ?
Component:
<aura:component implements="flexipage:availableForAllPageTypes,force:lightningQuickActionWithoutHeader,force:hasRecordId">
<aura:attribute name="myFields" type="List" default="['Case_Investigation__c','Investigation_Subject__c','Investigation_Email_Preference__c','Tier2_Agent__c','SuppliedEmail']"/>
<lightning:recordForm
recordId="{!v.recordId}"
objectApiName="Case"
columns="2"
fields="{!v.myFields}"
mode="edit"
onsubmit="{!c.handleSubmit}"/>
</aura:component>
Here's a quick example of how to show and hide fields idiomatically in a Lightning component. This is an abbreviated example that's meant to show the structure, not a working component! I'd encourage adapting this type of structure to your specific needs
Can you show me how can i incorporate showing/hiding a field with the lightning record form?
Did you find a way to hide/show custom fields based on picklist field values?