Difference between WhoID and WhatID


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


Cheers!!!

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.


Cheers!!!

Difference between ISBLANK and ISNULL


ISBLANK
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.

Cheers!!!

Difference between Sandbox and Developer Edition



Sandbox
Developer Edition
The salesforce.com Sandbox environment is an exact copy of your salesforce.com 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

https://www.salesforce.com/form/signup/freetrial-force-form.jsp?d=70130000000G3R3

Cheers!!!

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

Cheers!!!

Salesforce DEV 401 Book

For DEV 401 Book, visit the below link

http://www.packtpub.com/salesforce-certified-with-force-com-developer-handbook/book

All the best...


Cheers!!!

Salesforce certification exam schedule

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

http://certification.salesforce.com/schedules


Cheers!!!

Salesforce jobs



Cheers!!!

System.assertEquals

System.assertEquals(arg1,arg2) asserts if arg1 and arg2 are same, else it throws an error. It is mainly used for tracking errors.

Example1:

//Perfect System.assertEquals
try
{
    Integer i =90;
    System.assertEquals(i,90);
}
catch(Exception e)
{
}

Example2:

//Erroneous System.assertEquals
try
{
    Integer i =95;
    System.assertEquals(i,90);
}
catch(Exception e)
{
}


Cheers!!!

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.


Cheers!!!

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.


MemberIterable:

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;
       }
       i++;
       return memList[i-1];
   }
}

callMemberIterable:

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

memberBirthdayBatch:

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) {
       List<
Member__c> memsToUpdate = new List<Member__c>();
       System.debug('Member list size is ' + scope.size());
       for(
Member__c m : scope) {
           Date myDate = date.today();
           Integer todayDy = myDate.day();
           Integer todayMon = myDate.month();
           System.debug('Day is ' + m.
Birthday__c.day());
           Integer dy =  m.
Birthday__c.day();
           Integer mon =  m.Birthday__c.month();
           if(todayDy == dy && todayMon == mon) {
               Messaging.SingleEmailMessage email = new Messaging.SingleEmailMessage();
               List<String> toAddresses = new List<String>();
               toAddresses.add(m.E_Mail_Id__c);
               email.setToAddresses(toAddresses);
               List<String> ccAddresses = new List<String>();
               ccAddresses.add('magulancse24@gmail.com');
               email.setCcAddresses(ccAddresses);
               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>';
               email.setHtmlBody(message);
               Messaging.sendEmail(new Messaging.SingleEmailMessage[]{email});
           }
       }
   }
   global void finish(Database.batchableContext info) {
   }
}

scheduleBirthdayWish:

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

        Database.executeBatch(mbw);         
    }
}

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