Apex

Test class for batch apex

Batch apex is always in rescue whenever you need to process a huge chunk of data.

Consider the following batch apex. 

The business functionality it achieves is.

Check for a change in a custom field called keywords__c in Account object and Insert that topic into a community.

Automating Approval process with Apex trigger

Lets take a sample requirement 'I want to submit an Opportunity record to Salesforce approval process when opportunity Amount is greater than one lakh'. Before writing the Trigger you first you should create a 'Salesforce Approval Process' and the process should have matching criteria(Greater than 1 lakh). To create a approval process go through this link.

Apex Exception Email to defined user

Apex Exception Email is going to, or released in winter 16 according to time you are reading this post.

What is Apex Exception Email:
    Before winter'16 when an Apex code encounters unhandled exception it sends the exception email to LastmodifiedBy user email address of the class or trigger.But now we can specify which user should receive the exception email.

Redirecting to standard New,Edit,View and clone without removing override

Hi All,

I hope this post will save some time for Developers and Admins . The title may sound complex but its as simple as eating a chocolate. Most of the Salesforce geekys know Salesforce actions like creating new record,editing a record and cloning etc are based on URL and component Id.

Lets take Account object. I have to overrode the account view with 'AccountView' visualforce page.

Maximum size of List,Set,Map and String

Hope all are waiting for our Independence day celebration(For Indian's)

Today I got a new topic. I know its a small one. But I hope every body searched for this. Lets go through in deep. Apex has primitive data types. Those are Blob,Boolean,Date,Double,String etc. Each has their own property and limit. Example Boolean is 0 or 1, Double has minimum value of -2^63 and maximum value of 2^63. Apart from primitive type Apex has collections called List,Set and Map. While do operation on collection of records we will use this Apex collections.

Solution for: System.TypeException: Cannot have more than 10 chunks in a single operation.

Hi All,

Assume that you have hybrid list of SObject.Which means many sobject records(Account,Contact,Lead etc) in single List.When you try to perform a DML operation on this list you will encounter the following error.

System.TypeException: Cannot have more than 10 chunks in a single operation.

As all we know Salesforce platform runs everything(Soql,DML and CPU time etc) based on governor limit.The same is applying in this hybrid list.