• 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,

when i try to pass value it shows Formula Expression is required on the action attributes When checkbox clicked in UI

Visual Page

                   <apex:inputcheckbox value="{!allbranch}"> 
                        <apex:actionSupport event="onchange" action="{!selectedvalue}" reRender="out"/>
                    </apex:inputCheckbox> All Branch <br/>
                    <apex:inputcheckbox value="{!branch1}"> 
                        <apex:actionSupport event="onchange" action="{!selectedvalue}" reRender="out"/>
                    </apex:inputCheckbox> branch1<br/>

Apex

public boolean allbranch{get;set;}
 public boolean branch1{get;set;}​

public String selectedvalue(){
        String query = '';
        if(allbranch == true)
        {
          // System.debug('Ouput Value---------------------------- allbranch'+allbranch);
           query = '';
        }
        if(branch1== true)
        {
           //System.debug('Ouput Value---------------------------- '+branch1);
           query = 'Branch__c = XXXX';
        }
       System.debug('*************************************query Value ---'+query);
        return query;       
    }
       
    public PageReference pageLoad() {
       city = selectedvalue();
       //System.debug('Selected city:------------------------ '+city);
}

Can any one try to resolve this problem.

Thank you..
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,

i want to pass radiobutton value to apex pageload.i am using following code to pass  the value But it shows Formula Expression is required on the action attributes after the radio button is clicked.can any one try to resolve the error.

VisualPage

<apex:page cache="false" controller="AppointmentCalendarController" action="{!pageLoad}">
    <script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"></script>
    <script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/jquery-ui.min.js"></script>
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"/>
    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
         
    <link href="{!$Resource.fullCalendarCSS}" rel="stylesheet" />
    <link href="{!$Resource.fullCalendarPrintCSS}" rel="stylesheet"  media="print"/>
    <script src="{!$Resource.momentMinJS}"></script>
    <script src="{!$Resource.fullCalendarMinJS}"></script>
   
    
    <script>
        //We need to wrap everything in a doc.ready function so that the code fires after the DOM is loaded
        var add_newAppointment = '<img src="{!URLFOR($Resource.Image, 'plus_orange.png')}" onclick = "image_onclick()" /> '; 
        $(document).ready(function() {   
            //Call the fullCallendar method. You can replace the '#calendar' with the ID of the dom element where you want the calendar to go. 
            $('#calendar').fullCalendar({
                header: {
                    left: 'prev,next today',
                    center: 'title',
                    right: 'month,agendaWeek,agendaDay'
                },
                viewRender: function(view,element){
                    $(".fc-day-number").prepend('<img src="{!URLFOR($Resource.Image, 'plus_orange.png')}" onclick = "image_onclick()" /> ');
                   
                }, 
                editable: false,
                events:
                [
                    //At run time, this APEX Repeat will reneder the array elements for the events array
                    <apex:repeat value="{!events}" var="e">
                        {
                            title: "{!e.title}",
                            
                            start: '{!e.startTimeString}',
                            end: '{!e.endTimeString}',
                            url: '{!e.url}',
                           <!--allDay: {!e.allDay},  -->
                            className: '{!e.className}'
                        },
                    </apex:repeat>
                ]
            });
             
        });
    
        function image_onclick() 
        {
            //window.location.href = "apex/TimeSheetNew";
            var dt = $('#selectedDay').val(); 
            //var dt = date.format('YYYY-MM-DD');
            //alert(date.format('MM'));
            var cdate = $('#calendar').fullCalendar('getDate').format('YYYY-MM-DD');
            var start = moment(dt);
            var end = moment(cdate);
            var df = start.diff(end, 'days');
            if(df < -2 )
            {
                alert('Entries on elapsed date is not allowed.');
            }
            else if (df >0 )
            {
                alert('Entries for future date is not allowed.');
            }
            else
            {
               
                    window.open('TimeSheetNew?dt='+ dt + '&source=calendar', '_blank');
               
            }
            
        }
    </script>
     
    <!--some styling. Modify this to fit your needs-->
    <style>
        #cal-options {float:left;}
        #cal-legend { float:right;}
        #cal-legend ul {margin:0;padding:0;list-style:none;}
        #cal-legend ul li {margin:0;padding:5px;float:left;}
        #cal-legend ul li span {display:block; height:16px; width:16px; margin-right:4px; float:left; border-radius:4px;}
        #calendar {margin-top:20px;}
        #calendar a:hover {color:#fff !important;}
         
        .fc-event-inner {padding:3px;}
        .chennai{background:#2EFE2E;border-color:#2EFE2E;}
        .trichy{background:#21CBED;border-color:#21CBED;}
        .erode{background:#cc9933;border-color:#cc9933;}
        .puducherry{background:#FF5190;border-color:#FF0000;}
        .mumbai{background:#9933FF;border-color:#9933FF;}
        .indoor{background:#1967c0;border-color:#1967c0;}
        <!--.Others {background:#E88887;border-color:#E88887;}
        .event-personal {background:#1797c0;border-color:#1797c0;}-->
    </style>
     
    <apex:sectionHeader title="TimeSheet Calendar " >
    
    </apex:sectionHeader>
     <apex:outputPanel id="calPanel"> 
        <apex:form >
                 
           <div id="cal-options">
              <!-- <apex:commandButton value="{!IF(includeMyEvents,'Hide My Events','Show My Events')}" action="{!toggleMyEvents}"/> -->
            </div> 
            <div id="cal-legend">
                <ul>
                    <li style="{!IF(includeMyEvents,'','display:none')}"><span class="chennai"></span>Chennai</li>
                    <li style="{!IF(includeMyEvents,'','display:none')}"><span class="trichy"></span>Trichy</li>
                    <li style="{!IF(includeMyEvents,'','display:none')}"><span class="erode"></span>Erode</li>
                    <li style="{!IF(includeMyEvents,'','display:none')}"><span class="puducherry"></span>Puducherry</li>
                    <li style="{!IF(includeMyEvents,'','display:none')}"><span class="mumbai"></span>Mumbai</li>
                    <li style="{!IF(includeMyEvents,'','display:none')}"><span class="indoor"></span>Indoor</li>
                   <!--  <li style="{!IF(includeMyEvents,'','display:none')}"><span class="Others"></span>Others</li>
                   <li style="{!IF(includeMyEvents,'','display:none')}"><span class="event-personal"></span>My Events</li> -->
                </ul>
                <div style="clear:both;"><!--fix floats--></div>
            </div>
            <div style="clear:both;"><!--fix floats--></div>
            <div class="col-md-2">
                <div class="content-box" id="external-eventslink">
                    <h3 class="content-box-header bg-default">
                        Select Branch
                    </h3>
                    <apex:selectRadio value="{!selectedValue}">
                        <apex:selectOption itemLabel="All Branch" itemValue="Allbranch" ></apex:selectOption>
                        <apex:selectOption itemLabel="Chennai" itemValue="Chennai"></apex:selectOption>
                        <apex:selectOption itemLabel="Trichy" itemValue="Trichy"></apex:selectOption>
                        <apex:selectOption itemLabel="Erode" itemValue="Erode"></apex:selectOption>
                        <apex:selectOption itemLabel="Puducherry" itemValue="Puducherry"></apex:selectOption>
                        <apex:selectOption itemLabel="Mumbai" itemValue="Mumbai"></apex:selectOption>
                        <apex:selectOption itemLabel="Indoor" itemValue="Indoor"></apex:selectOption>
                        
                        <apex:actionSupport event="onchange" action="{!checkSelectedValue}" reRender="none"/>
                     </apex:selectRadio>
                                    </div>
            </div>
            <div class="col-md-10">
            <div name="calendar" id="calendar"></div>
            <input type="hidden" id="selectedDay" /> 
            </div>
            
             
        </apex:form>
    </apex:outputPanel>
</apex:page>

ApexController

public class AppointmentCalendarController{

    public transient Boolean includeMyEvents {get;set;}
    public transient list<calEvent> events {get;set;}
    public string selectedValue{ get; set; }
    public string city{ get; set; }
 
    //The calendar plugin is expecting dates is a certain format. We can use this string to get it formated correctly
    private transient String  dtFormat = 'EEE, d MMM yyyy HH:mm:ss z';
     
    //constructor
    public AppointmentCalendarController() {
    
        includeMyEvents = true;
    }
       
     public string checkSelectedValue(){        
        System.debug('seleced value-----'+selectedValue);        
        return selectedValue;
    } 
       
    public PageReference pageLoad() {
        city = checkSelectedValue();
        System.debug('Selected city: '+selectedValue);
        events = new list<calEvent>();
          if(includeMyEvents)
          {  
           for(Appointment__c app: [select Id, Name, Branch__c, Services__c,Start_Time__c,End_Time__c from Appointment__c WHERE Branch__c = city ])
           // for(Appointment__c app: [select Id, Name, Branch__c, Services__c from Appointment__c])
            {
               
                calEvent myEvent = new calEvent();
                 
                myEvent.title = app.Branch__c;
                
                    myEvent.startTimeString = app.Start_Time__c.format('MM/dd/yyyy HH:mm:ss');
                    myEvent.endTimeString = app.End_Time__c.format('MM/dd/yyyy HH:mm:ss');
                    myEvent.url = '/' + app.Id;
                
                myEvent.className = app.Services__c;
                events.add(myEvent);
            }
        }
        return null;
    }
    
    public PageReference toggleMyEvents()
     {
        if(includeMyEvents){
            includeMyEvents = false;
        }
        else{
            includeMyEvents = true;
        }
        pageload();
        return null;
    }    
 
     
    //Class to hold calendar event data
    public class calEvent
    {
        public String title {get;set;}
        //public Boolean allDay {get;set;}
        public String appointmentDateString {get;set;}
        public String startTimeString {get;set;}
        public String endTimeString {get;set;}
        public String url {get;set;}
        public String className {get;set;}
    }
}

waiting for response..

Thank you...
Hi all,

i want build an appointment application with integrating calendar in salesforce lightning and also i want to do some validation.
(Like only one appoinment allowed particular time).how can i do it can any one try to help me.

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 using Lefleat Packge for display google map but it doesn.t show the map(No error is displayed).in this  link http://leafletjs.com/download.html i found 3 packages and try that 3 packages(Uploaded in static resources)but display only empty screen.the soucrce code i am using is given below.

AccountMap.cmp
<aura:component>

    <aura:attribute name="map" type="Object"/>

    <ltng:require styles="/resource/leaflet/leaflet.css"
        scripts="/resource/leaflet/leaflet.js"
        afterScriptsLoaded="{!c.jsLoaded}" />

    <div id="map"></div>

</aura:component>

AccounMapController.js
({
   jsLoaded: function(component, event, helper) {

    setTimeout(function() {
        var map = L.map('map', {zoomControl: false})
                    .setView([37.784173, -122.401557], 14);
        L.tileLayer(
         'https://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer/tile/{z}/{y}/{x}',
         {
                attribution: 'Tiles © Esri'
         }).addTo(map);
        component.set("v.map", map);
    });
  }
})

AccountMap.js
.THIS {
   width: 100%;
   height: 100%;
}

waiting for response.

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 am working on Salesforce Lighning.when i create a new account it shows notification in salesforce 1.how can i do it.i already enabled push notification option in lightning.Can any one try to help me.

Thanks..

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..
Hi all,

 Is there any Bluetooth Print device avilable for Saleforce1 like printing invoice.when a salesman is in client place they have to genertae invoice in saleforce 1 and print the invoice.sales man have carry the device to customer location.is there any small and comfortable device available.waiting for replay..

Thank you
i am using below code.
editReord.cmp

<aura:component> 
    <ui:button label="Edit Record" press="{!c.edit}"/> 
</aura:component>

editRecordController.js
edit: function(component, event, helper) 
{
    var editRecordEvent = $A.get("e.force:editRecord");
    editRecordEvent.setParams({ "recordId": component.get("v.contact.Id") }); 
    editRecordEvent.fire(); 
}

when i am try to save controller it shows Invalid literal value [1, 1]: 'edit': Source.
what's error in the above code.
 
Hi all,

public with sharing class SimpleErrorController { }

In the above code what is the with sharing..
if i want to explain about salesforce lightning to my colleagues means what are things or topics i have to explain to them.
I want to Create Namespace in salesforce Lightning.i tried quickfindbox > Packages.But There is no Packages option.How can i create Namespace.

Thank you..,
What is the difference between  $A.get() and cmp.get() functions.
if i have an application in salesforce classic.is it possible to convert this application to saleforce lightning?.if possible menas how to do it?
Both Visualforce and lighning Components used to desighn ui.But i dont know what is the differense between this two.
Can any one tell What are the notable features in salesforce Lightning and what is the use of it and how it differ from salesforce classic.
 I want to create Custom App in salesforce lightning.i am using developer guide steps- From Setup, enter Apps in the Quick Find box, then select Apps.But there is no Apps option to select.Can you tell me How can i do it.i am waiting for your replay.

Thank you
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);
    }
})
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);
    }
})