• Varun Vyas 10
  • NEWBIE
  • 0 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 1
    Likes Given
  • 0
    Questions
  • 2
    Replies
Currently I m using next and previous arrow buttons on click of which i call my javascript function. I want to call this function on left and right swipe event. Can somebody suggest a way to capture the left and right swipe on my component?

Hi all.

 

As noted in this post that talks about notifications in Salesforce1, is there any document about the universal notification framework? I find nothing concerning “send push notifications to individuals and groups using Apex”.

 

Thanks.

 

 

I am new to apex programming and have been asked to look into an issue within a batch apex class created by an senior apex developer (s.a.d.). 

 

The setup:

 

My understanding of the execute method used with batch apex is that this method takes 2 things:

-A reference to the Database.BatchableContext object.
-A list of sObjects, such as List<sObject>, which is passed to the method for each batch of records

 

You can see both being passed into the s.a.d.'s code below:

 

The code:

 

global void execute(Database.BatchableContext BC, List<sObject> scope)
    {
        Set<String> branchZips = new Set<String>();
        Set<Id> branchPIds = new Set<Id>();

        
        // First, we collect all the unique zips from the branches into a set.
        for (sObject s : scope) {   
            Account a = (Account)s;
            if (a.Branch_Office_Zip_Code__c != null && a.Branch_Office_Zip_Code__c.length() == 5) {
                branchZips.add(a.Branch_Office_Zip_Code__c);
                branchPIds.add(a.ParentId);
            }
        }

 

My question:

 

Regarding list of sObjects (List<sObject> scope) being passed to the method I'm simply trying to understand what the developer is doing within the code.  My question:  Does it appear to you that the developer was passing list of sObjects in a variable "scope", taking each record from the  "scope", storing it in an sObject "s" and then casting that "s" sObject into an account object "a" with this code:  Account a = (Account)s?  If so, I've been trying to find information regarding this casting "technique" and why it's used and, more importantly, other examples.  This whole topic of casting appears to be widly used not just in apex programming but in other programming like java,  and I would like to understand it better.  I have been unable to find resources that clearly explain what it is and why you would do it and examples.   Thanks in advance!