September 28, 2012

Difference between WhoID and WhatID

Refers to object.
Refers to people.
Example: Account Id, Opportunity Id.
Example: Lead Id, Contact Id.


Roll up Summary field

Roll up Summary field is a read only field that displays

1. Count
2. Sum
3. Min
4. Max

from the child records of a related list.


Difference between ISBLANK and ISNULL

Determines if an expression has a value and returns TRUE if it does not. If it contains a value, this function returns FALSE.
Determines if an expression is null (blank) and returns TRUE if it is. If it contains a value, this function returns FALSE.
Text fields cannot be null. So use mainly for text fields.
Numeric fields cannot be blank. So use mainly for numeric fields.


Difference between Sandbox and Developer Edition

Developer Edition
The Sandbox environment is an exact copy of your instance.
Developer Edition was an edition created for development of integrations and apps, specifically for the AppExchange.
You can copy your live instance to a sandbox environment.
You have to perform manually from sandbox to developer edition.
You can either copy your configuration and data into a sandbox environment or just the configuration.
You cannot copy your configuration or data onto the Developer Edition, but you can customize it to match your instance’s look and feel.

For trial version, just create login credential using the below link


September 27, 2012

Editable in the objects and tabs section of the enhanced user profile interface

Editable in the objects and tabs section of the enhanced user profile interface after Summer '11 release are as follows
  1. Page layout assignments
  2. System Permissions


Salesforce DEV 401 Book

For DEV 401 Book, visit the below link

All the best...


September 26, 2012

Salesforce certification exam schedule

To maintain Salesforce Certification credentials, all certified professionals must successfully complete release maintenance exams specific to their credential. Depending on your credentials, you may have anywhere from one to three release exams per credential to complete each year.

To know the Salesforce certification exam schedule, visit the below link

Salesforce jobs



Asserts that the first two arguments are the same. If they are not, a fatal error is returned that causes code execution to halt.

Sample Code:


trigger AccountTrigger on Account ( before insert ) {

    for ( Account acct : ) {
        if ( acct.Name == 'Test Account' )
            acct.Description = 'Test';

Test Class:

private class SampleTestClass {

    static testMethod void insertAcctTest() {

        Account acc = new Account(Name = 'Test Account');
        insert acc;
        acc = [ SELECT Description FROM Account WHERE Id = : acc.Id ];
        System.assertEquals('Test', acc.Description);



In the above example, the expected Description of the Account is 'Test'. If any other additional processes like Workflow Field update, Process Builder, etc updates the Description other than 'Test', it will throw an error and fails the test method. This will make sure that developed code is working as expected.

Opposite to System.assertEquals() is System.assertNotEquals().

September 25, 2012

Changing Lookup to Master-Detail relationship

For changing Lookup to Master-Detail relationship, ensure that existing records are properly parented. Before changing Lookup to Master-Detail relationship, all the records should have lookup values.

If a field is created on Object 'B' with relation Lookup/Master-Detail to Object 'A', then Object 'A' is Parent/Master and Object 'B' is Child/Detail.


September 24, 2012

Birthday Reminder or Automatic Birthday wisher using apex in Saleforce

For Birthday Reminder or Automatic Birthday wisher using apex in Saleforce, use the below codes. I have implemented this using Batch Apex.


global class MemberIterable implements Iterator<Member__c{
   List<Member__c> memList{get; set;}
   Integer i {get; set;}

   public MemberIterable() {
       memList = [SELECT E_Mail_Id__c,
Birthday__c FROM Member__c];
       i = 0;
   global boolean hasNext() {
       if(i >= memList.size())
           return false;
       } else {
           return true;

   global Member__c next() {
       if(i > memList.size()) {
           return null;
       return memList[i-1];


global class callMemberIterable implements iterable<Member__c> {
   global Iterator<
Member__c> Iterator() {
      return new memberIterable();


global class memberBirthdayBatch implements Database.batchable<Member__c> {
   global Iterable<
Member__c> start(Database.batchableContext info) {
       System.debug('Start method');
       return new callMemberIterable();
   global void execute(Database.batchableContext info, List<
Member__c> scope) {
Member__c> memsToUpdate = new List<Member__c>();
       System.debug('Member list size is ' + scope.size());
Member__c m : scope) {
           Date myDate =;
           Integer todayDy =;
           Integer todayMon = myDate.month();
           System.debug('Day is ' + m.;
           Integer dy =  m.;
           Integer mon =  m.Birthday__c.month();
           if(todayDy == dy && todayMon == mon) {
               Messaging.SingleEmailMessage email = new Messaging.SingleEmailMessage();
               List<String> toAddresses = new List<String>();
               List<String> ccAddresses = new List<String>();
               email.setSubject('Happy Birthday. Have a blast -- Birthday Reminder!');
               String message = '<html><table cellspacing = "7"><tr><td style="font-weight:bold;color:green;">Happy Birthday!!!</td></tr><tr><td style="font-weight:bold;color:pink;">Many more Happy returns of the day.</td></tr><tr><td></td></tr><tr><td></td></tr><tr><td style="font-weight:bold;">Cheers,</td></tr><tr><td style="font-weight:bold;">Magulan D</td></tr></table></html>';
               Messaging.sendEmail(new Messaging.SingleEmailMessage[]{email});
   global void finish(Database.batchableContext info) {


global class scheduleBirthdayWish implements Schedulable {
    global void execute(SchedulableContext SC) {
        memberBirthdayBatch mbw = new memberBirthdayBatch();


Schedule the 'scheduleBirthdayWish' as mentioned below in App Setup --> Apex Classes --> Schedule Apex and select 'scheduleBirthdayWish' class. Check Weekly and select all the days. Give Start and End dates and Preferred Start time and Click 'Save' button.

To check the scheduled job, go to Administration Setup --> Monitoring --> Scheduled Jobs