Saturday, 29 April 2017

Salesforce Essentials - 23(Batch Apex in Salesforce )

To use batch Apex, write an Apex class that implements the Salesforce-provided interface Database.Batchable and then invoke the class programmatically.
To monitor or stop the execution of the batch Apex job, from Setup, enter Apex Jobs in the Quick Find box, then select Apex Jobs.






It allows you to define a job that can be divided into manageable chunks, where each chunk can be proceed separately.

 Methods defined in batch apex class?

To use Batch Apex, you must implement “Database.Batchable”. This interface has three methods. those are:
1. Start
2. execute
3. Finish


 Return types and syntaxes of all methods of batch apex class?

 Start:

global (Database.QueryLocator | Iterable<sObject>) start(Database.BatchableContext bc) { }

Execute: 

global void execute(Database.BatchableContext BC, list<P>){ }
Finish:



global void finish(Database.BatchableContext BC){ }


Sample Code :

global class Accountupdate implements Database.Batchable<sObject>
{

global Database.QueryLocator start(Database.BatchableContext BC)
{
        String query = 'SELECT Id,Name,Phone FROM Account ';
        return Database.getQueryLocator(query);
    }

    global void execute(Database.BatchableContext BC, List<Account> scope)
    {
        for ( Account a : scope)
        {
           a.Phone='123';
        }
        update scope;
    }  
    global void finish(Database.BatchableContext BC)
    {
    }
}






When we need to go for batch apex class?
  • When you want to do a bulk job.
  •  To have higher governor limits. 
  •  We can schedule to run at different time.
References :

https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_batch_interface.htm
https://developer.salesforce.com/forums/?id=906F0000000BOduIAG

Monday, 24 April 2017

Today's Adventure - Salesforce Summer ’17


When Do Features Become Available?


Some features in Salesforce Summer ’17 affect all users immediately after the release goes live. Consider communicating these changes to your users beforehand so that they’re prepared.The Salesforce Summer’17 release is now in available under the pre-release program.

Get Better Assistance with the Restyled Lightning Experience Migration Assistant


Salesforce has given the Migration Assistant an easier-to-use, wizard-style interface.Accessing the Migration Assistant in Salesforce Classic is a no-brainer now. From Setup, click Get Started in the Lightning Experience Migration Assistant tile at the top of the menu. 

Switch More Users to Lightning Experience

 To help, the Switch Users to Lightning Experience tool now displays all users in your org, so you can switch the exact group that you want in one go. The tool also makes it easier to find specific users in the list and to see which users in your org are eligible to switch. This change applies to both Lightning Experience and Salesforce Classic.

Make Lightning Experience - the Only Experience 


Ready to move from Salesforce Classic to Lightning Experience without looking back? Just hide the option to switch to Salesforce Classic from your Lightning Experience users so that they stay in Lightning ExperienceThis feature is new in both Lightning Experience and Salesforce Classic.

Now you can create a permission set and assign it to different profile.

When you enable the permission for your Lightning Experience users, new and existing users see Lightning Experience the next time they log in to Salesforce. And, they no longer see the Switch to Salesforce Classic link.








Ditch Your Mouse

You can now use keyboard shortcuts to maximize your efficiency and speed while working in Lightning Experience. 


Navigate to a Record Directly from an Action Success Message

The message now includes the record name as an active link that takes you right to that record

Access Field History Related Lists in Lightning Experience

Track and display the field history for standard or custom objects, regardless of which Salesforce interface you’re using. If you added the History related list to objects in Salesforce Classic, you can now see it in Lightning Experience.
  1. Click the Object Manager tab, and select an object from the list
  2. In the left pane, click Fields and Relationships and then click Set History Tracking
  3. Select the fields you want to track
  4. Add that related list to your object’s page layout
Preview Case Details with Case Hovers

Users can hover over cases to get a sneak peek at the details, including the description and latest update
Find Favorites with a Simplified Favorites List
Salesforce has removed the top favorites section from your favorites list to simplify the way you access your favorite pages in Salesforce. Favorites give you instant access to important records, lists, groups, dashboards, and other frequently used pages. 
References - 

Please follow the amazing blogs for more detailed Information 

http://releasenotes.docs.salesforce.com/en-us/summer17/release-notes/rn_general_lex_no_top_favorites.htm?edition=&impact=

https://automationchampion.com/2017/04/23/salesforce-summer17-release-quick-summary/

https://pritamshekhawat.wordpress.com/2017/04/23/salesforce-summer17-top-17-features-of-lightning-experience/?utm_content=buffer9fcdb&utm_medium=social&utm_source=twitter.com&utm_campaign=buffer







Saturday, 22 April 2017

#SalesforceSatuday – 22nd April

Successful Salesforce Chandigarh Developer User Group and #SalesforceSatuday Session
Its was amazing hosting the first #SalesforceSaturday with Cakes , Coffee and Salesforce with Swags.


 


We had a amazing conversation about Salesforce Certifications which made us think and agree on path to complete at-last 3 Certifications(Chandigarh developer group) before 2nd Salesforce Saturday thats - 2nd Saturday  of  May.
Also we had an amazing Discussion about how we can help community in expanding colleges and We will be soon out with some awesome information.
Moreover stay tuned !
Here is the Presentation for the Certification Path we had as part of the Salesforce Chandigarh Developer User Group session on 22rd April, 2017

Thursday, 20 April 2017

Salesforce Essentials - 22(Login Failed in Apex Data-loader)




If you are getting  a failed to send request error you may need to check  the server host Data Loader setting. 

Resolution -Whenever you receive the error Failed to send request to http://localhost/services/Soap/check the following:  1. Go into Settings | Settings and change the server name to https://www.salesforce.com 2. If logging into the sandbox, then the URL is https://test.salesforce.com
Check if your network is using a proxy - Getting the error message, "Failed to send request to https://www.salesforce.com/services/Soap/u/31.0" typically indicates that you're going through a proxy server resulting in your login attempt from the Data Loader not making it from your local machine to Salesforce servers. If your network is utilizing a VPN, you'll need to include or set your proxy information in the Data Loader settings. We recommend contacting your IT department to get the following pieces of information:
- Proxy host
- Proxy port
- Proxy username
- Proxy password settings
Check network connectivity or local machine issues - Review the affected user record's login history. If the Data Loader's login attempt has been recorded, you'll want to check the login attempt status. You'll be looking for login attempts that failed due to:
- Incorrect password
- Login restrictions
- Missing a required security token(For Developer Edition, give password+security token as password. Username is as usual username.)
If you've confirmed that these are correct and the login attempt is still not recorded this is indicative of a firewall, router, switch, or other network related device or connectivity issue that's preventing the Data Loader's login attempt from properly reaching the Salesforce servers.
You may troubleshoot potential network issues by running the network tests outlined in the article, How do I run a ping and traceroute to Salesforce? and reviewing the results as outlined in the article, How to Interpret the Traceroute? to determine whether it may be appropriate to engage your IT or network administration team to investigate or for further assistance.
If you continue to see an issue and have ruled out the above causes you may also try completely uninstalling the Data Loader and Installing Data Loader once again or trying to login via the Data Loader on another machine to potentially identify and/or rule out the behavior being an installation or local machine issue.


Reference - 

https://help.salesforce.com/articleView?id=000005262&language=en_US&type=1
https://salesforce.stackexchange.com/questions/77987/apex-dataloader-login-error

Monday, 17 April 2017

Time To Upvote -Series (Part 1)

Here we have some idea's which need to be upvoted :


Idea 1 

Field Dependency on Standard Fields (NOT Custom Fields Only)


Currently you can setup a field dependency relationship on two picklists in an object. The controlling field can be a standard field, but the dependent field must be a custom field. Please allow the dependent field to be a standard field as well.


Idea 2 

Related List Sorting - More than one choice


Currently related lists can only be sorted by one field. This should be increased to more options to allow sorting levels. I'd suggest 3-5 different field selections, each being able to select Ascending or Descending.

Idea 3

Add a new Standard field type: Address
Often times Address blocks need to be added to Custom Objects are even Standard Object (often to Opportunities for example to identify precise shipping locations). The Address type already exists but Admins can't create them. Open it up! ; )


Idea 4

Activity Related to Default

When creating an activity, the user can relate the task or even to several objects, including custom objects. It would be great if the administrator can select the default object to appear for the drop down list. Currently it points out to opportunity by default. In my case, I would like it to point out to Equipment which is a custom object. However this should be done on each activity layout page. Thus if I have a group of users that mostly track activities with contracts, then contracts will be default. This saves the user one step in creating the activity.

Additionally the Related to filed can be made to have a validation rule that requires de user to enter a value, if a specific object is selected in the drop down list.

Thus: User creates an activity; Equipment is by default in the drop down list; if user forgets to enter a value in the Related to field, the validation forces the user to enter a value. If however the user changes the choice to Account or other choice, we may or may not require a value in the field for that choice. This will ensure that the proper values are captured for reporting purposes. I can then have peace of mind that my activities report for Equipment correctly reflects all the activities relevant to that object.

Upvote

Please refer the following - https://success.salesforce.com/ideaSearch



Sunday, 9 April 2017

Salesforce Essentials - 21(Steps to Download Apex Data Loader )



The Salesforce Data Loader / Apex Data Loader is a client application for the bulk import or export of data. Use it to insert, update, delete, or extract salesforce.com records.


Frequently, you will use the Force.com platform to create applications that operate on data that you already have in some form - in comma-separated variable files, spreadsheets or other relational databases.
The Data Loader is an easy to use graphical tool that helps you to get your data into Salesforce objects. The Data Loader can also be used to extract data from database objects into any of the destinations mentioned above. You can even use the Data Loader to perform bulk deletions by exporting the ID fields for the data you wish to delete and using that source to specify deletions through the Data Loader.

Steps to Download Apex Data Loader :

1. Go to Setup - Administration Setup - Data Management - Data Loader in your org.
2.  Click "Download the Data Loader" link to download the data loader.






Reference - https://developer.salesforce.com/page/Data_Loader