• komal pulani 2
  • NEWBIE
  • 10 Points
  • Member since 2018

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 5
    Questions
  • 1
    Replies
Hi, I have a requirement where i want to change the value of attribute insode the aura:if.
I want to set the value of disableActivityDate to True if  BranchValue!=null .Here is my code:
 <aura:attribute name="disableActivityDate" type="String" default="true"/>
 <aura:If isTrue="{!v.BranchValue!=null}">                              
   <lightning:inputField fieldName="Activity_Date__c" aura:id="dateField" onchange="{!c.resetActivityTimeSelection}" disabled="{!v.disableActivityDate}"/>   
                       </lightning:layoutItem>
                      </aura:If>
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 
I have my organisation data in Smart Office and now I want to export data from there and import it to Salesforce. Is there any way to export bulk data from Smart Office? 
Hi,
I want to display the startaddress and endaddress field only when the picklist value is selected as 'Gas' .PFB apex and controller classes
The  call to function is not getting made.
Can anyone please help me on this ?

<apex:page docType="html-5.0" controller="Expense">
    
    <script>
    function gasselect(val)
    {
    alert(document.getElementById('abcId').value);
    if(val=="Gas")){
    
    document.getElementById("myid").style.visibility="visible";
       
         }
    }
    
    </script>
    <apex:form >
    
        <apex:pageBlock  >
    <apex:pageBlockSection columns="1">

        <div id="myid" style="visibility:hidden">
    <apex:inputTextarea  value="{!startaddress}"/>
         <apex:inputTextarea value="{!endaddress}"/>
         <apex:inputText value="{!distance}"/>
    </div>
       
        Date Of Expense: <apex:input type="date" value="{!expense_date}"/><br></br>
        
        <apex:actionRegion >
         <apex:pageBlockSection >
        
        Expense Type: <apex:selectList value="{!expensetype}" size="1" onchange="gasselect(this.value);" >
                      <apex:selectOptions value="{!expenseOptions}"/>
                        </apex:selectList><br></br>
                        
             
                        
                      
            </apex:pageBlockSection>
            </apex:actionRegion>
       
        
 
        
        Expense Description: <apex:inputTextarea value="{!expense_desc}"/> <br></br>
        Expense Amount: <apex:inputText value="{!amount}"/>
            
        <apex:commandButton value="Submit" action="{!save}"/>
              </apex:pageBlockSection>
    </apex:pageBlock>
    </apex:form>
</apex:page>


public class Expense
{
    public Date expense_date
    {
    get;
    set;
    }
    public String expensetype
    {
    get;
    set;
    }
    public Integer name
    {
    get;
    set;
    }
    public String expense_desc
    {
    get;
    set;
    }
    public Decimal amount{
    get;
    set;
    }
    public Integer distance
    {
    get;
    set;
    }
    public string endaddress
    {
    get;
    set;
    }

 public string startaddress
    {
    get;
    set;
    }
   public List<ExpenseTracker__c> c=new list<ExpenseTracker__c>();
    
    public List<SelectOption> getExpenseOptions() {
        List<SelectOption> expenseOptions = new List<SelectOption>();
        expenseOptions.add(new SelectOption('','-None-'));
        expenseOptions.add(new SelectOption('Flight','Flight'));
        expenseOptions.add(new SelectOption('Meals','Meals'));
        expenseOptions.add(new SelectOption('Gas','Gas'));
        expenseOptions.add(new SelectOption('Others','Others'));
        return expenseOptions;
    }
   
    public PageReference save()
    {
    ExpenseTracker__c c=new ExpenseTracker__c();
    
    c.expense_date__c=expense_date;
    c.amount__c=amount;
    c.distance__c=distance;
    c.endaddress__c=endaddress;
    c.expense_date__c=expense_date;
    c.expense_description__c=expense_desc;
    c.expensetype__c=expensetype;
    c.startaddress__c=startaddress;
    
    insert c;
    return new PageReference ('/apex/ExpenseTracker');

    }
}

 
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