• satheesh p
  • NEWBIE
  • 90 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 20
    Questions
  • 16
    Replies
Hi All,

i want to pass value if the checkbox is clicked.The below code is i am used

Visualforcepage

<apex:inputCheckbox value="{!isallbranch}" onchange="checkSelectedValue" selected ="true"/> All Branch
<apex:inputCheckbox value="{!isallbranch}" onchange="checkSelectedValue" /> Branch1

Apex

Public boolean isallbranch{get;set;} 
Public boolean myvalue{get;set;}
Public boolean myvalue1{get;set;}

public string checkSelectedValue(){ 
     if(!isallbranch == true)       
        System.debug('isallbranch value----- is true');   
        myvalue = "test";
       return myvalue;
    } 
       
    public PageReference pageLoad() {
     myvalue1 = checkSelectedValue();
     for(myobi__c mynobj :[ select field1__c,field2__c from myobj__c WHERE field1 = myvalue1] )
     { }
    }

is this possible or is there any alternative is available.give me a solution as soon as possible

Thank you..
Hi all,

i want to customize lightning calendar.how can i do it.can any one try to help me.

Thank you..
Hi All,
      
      I am trying to Build an Account Geolocation App.it show the follwing error.Unable to find 'findAll' on 'compound://my_namespace.AccountList
the bellow code is  i am using.

AccountCountroller.apxc
public with sharing class AccountController {
    @AuraEnabled
    public static List<Account> findall(){
        return [SELECT id,name,Location__Latitude__s,Location__Longitude__S FROM Account WHERE Location__Latitude__s != null AND 
                Location__Longitude__S != null Limit 50];
    }

}

AccounLocator.cmp
<aura:component implements="force:appHostable">
    <div>
        <div>AccountMap Goes Here</div>
        <div> <my_namespace:AccountList />  </div>
    </div>
</aura:component>

AccountLocatorApp.app
<aura:application >
    <ibrook_ibi:AccountLocator />
</aura:application>


AccountListItem.cmp
<aura:component >
    <aura:attribute name="account" type="Account"/>
    <li><a>{!v.account.Name}</a></li>
</aura:component>

AccountList.cmp
<aura:component controller="AccountController">

    <aura:attribute name="accounts" type="Account[]"/>
    <aura:handler name="init" value="{!this}" action="{!c.doInit}" />

    <ul>
    <aura:iteration items="{!v.accounts}" var="account">
        <my_namespace:AccountListItem account="{!account}"/>
    </aura:iteration>
    </ul>

</aura:component>

AccountController.js
({
    doInit : function(component, event) {
        var action = component.get("c.findAll");
        action.setCallback(this, function(a) {
            component.set("v.accounts", a.getReturnValue());
        });
        $A.enqueueAction(action);
    }
})

waiting for your response.

  Thank you..
I have some Lightning Componenet that was created in Developer console.is there any possible to add this component to salesforce1 Lightning App.
if it posiibele means how to do it. can any one try to help me.

Thank you..
if i want to explain about salesforce lightning to my colleagues means what are things or topics i have to explain to them.
What is the difference between  $A.get() and cmp.get() functions.
I am new to salesforce and am using Lightning Components Developer Guide(winter 17) to learn saleforce lighning.in this i am creating Expense app.it retrive the data corretly but when submiting the new expense it shows the following Error Message

Something has gone wrong. Assertion Failed!: no client action by name {!v.createExpense} : false Failing descriptor: {ui$button$controller$press}. Please try again.

How can i resolve the problem.

I am using follwing Code.
ExpenseController.axpc

public with sharing class ExpenseController 


    @AuraEnabled
    public static List<Expense__c> getExpenses() 
    { 
        // Perform isAccessible() check here  
        return [SELECT Id, Name, Amount__c, Client__c, Date__c, Reimbursed__c, CreatedDate FROM Expense__c]; 
    } 
   @AuraEnabled
    public static Expense__c saveExpense(Expense__c expense) {
    
        // Perform isUpdateable() check here
        upsert expense;
        return expense;
    }


FormController.js
({
doInit : function(component, event, helper) 
    { //Update expense counters 
        helper.getExpenses(component); 
    },//Delimiter for future code
  createExpense : function(component, event, helper) {
    var amtField = component.find("amount");
    var amt = amtField.get("v.value");
    if (isNaN(amt)||amt==''){
        amtField.set("v.errors", [{message:"Enter an expense amount."}]);
    }
    else {
        amtField.set("v.errors", null);
        var newExpense = component.get("v.newExpense");
        helper.createExpense(component, newExpense);
    }
},//Delimiter for future code
})

FormHelper.js

({ 
    getExpenses: function(component) 
    { 
        var action = component.get("c.getExpenses"); 
        action.setCallback(this, function(response) 
                           { 
                               var state = response.getState(); 
                               if (component.isValid() && state === "SUCCESS") 
                               { 
                                   component.set("v.expenses", response.getReturnValue()); 
                                   this.updateTotal(component); 
                               } 
                           }); $A.enqueueAction(action); 
    }, 
    updateTotal : function(component) 
    { 
        var expenses = component.get("v.expenses");
        var total = 0; for(var i=0; i<expenses.length; i++)
        { 
            var e = expenses[i]; //If you’re using a namespace, use e.myNamespace__Amount__c instead
            total += e.Amount__c; 
        } 
        //Update counters 
        component.set("v.total", total); 
        component.set("v.exp", expenses.length); 
    },
       createExpense: function(component, expense) {
        this.upsertExpense(component, expense, function(a) {
            var expenses = component.get("v.expenses");
            expenses.push(a.getReturnValue());
            component.set("v.expenses", expenses);
            this.updateTotal(component);
          });
    },
    upsertExpense : function(component, expense, callback) {
        var action = component.get("c.saveExpense");
        action.setParams({ 
            "expense": expense
        });
        if (callback) {
          action.setCallback(this, callback);
        }
        $A.enqueueAction(action);
    }
})