function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
komal pulani 2komal pulani 2 

I need to disable and enable a field on other field update

I have a requirement where if my field 'Branch' is not null then only the other field 'ActivityDate' should be enabled. Otherwise it should be disabled.
And also if i change the Branch value then ActivtyDate field should rest to null. I want to implement this change in Lightning 
MagulanDuraipandianMagulanDuraipandian
You have to use custom lightning component for this and override the button.
Use disabled attribute in the field to achieve this.
--
Magulan Duraipandian
www.infallibletechie.com
komal pulani 2komal pulani 2
Hi Magulan,
Thanks for the response.
But I do have a lightning component, in which i want to have the above functionality implemented.
<aura:attribute name="disableActivityDate" type="Boolean" default="true"/>
 <aura:If isTrue="{!not(empty(!v.BranchValue))}"> 
                 
                <lightning:layoutItem largeDeviceSize="6" smallDeviceSize="12" size="12" class="slds-col slds-p-left_small">                             
                    <lightning:inputField fieldName="Activity_Date__c" aura:id="dateField" onchange="{!c.resetActivityTimeSelection}" disabled="{!v.disableActivityDate}"/>   
                       </lightning:layoutItem>          
                </aura:If>

I want to set disableActivityDate as False inside aura if if my BranchValue is not null