Skip to main content

Posts

Showing posts from January, 2012

Forcing Opportunity Creating During the Lead Conversion Trigger

Lead Conversion is a process in Sales Cloud that helps users convert leads into related accounts and open new opportunities. This is useful in preventing rework of transferring data from lead fields to Account fields. The entire process of Copy Paste is done with a single touch of button and the data is transferred.
However, on business end, the customer has just closed the deal and now the company has earned an Account  Salesforce allows you to streamline the business processes by field mapping.

We can map custom fields on Lead object to Custom Fields on Contact, Opportunity or Account object using field mapping on Lead setup.

However, there are times when we need to extend the standard the Convert functionality for a more complex purposes for e.g.,
1. Transferring some related object from lead to Account, Opportunity or Contact.
2. Throwing an Error if the Opportunity is not created on Conversation

In this example I am going to create a trigger that throws an error if the Create Op…

Spring 12 Salesforce Contains a Bug... a lady bug.

Its freezing cold out here. When I say its cold, I mean its cold, the cruel hellish humid city of Mumbai is also wrapped in the basket of coldness and finally after a decade, Mumbaikars (people from mumbai) have a topic of conversation with Delhites (people from Delhi) over cold. But while the entire world is still coping with the cold of winter, the clouds have already moved on to spring.

Salesforce has come out with the Spring 12 release and it contains a bug, no not software bug but a lady bug on the leaf. Obviously on the glorious traditions, new updates to not mean patches to cover up your mistakes, it means glorious new features and new things. As with the tradition with this blog, this is a feature to discuss top ten features that I find interesting in the update.

Chatter Now
Instant messenger inside chatter is now Generally Available. This is a good move towards turning into the one tool for Enterprise 2.0 collaboration platform. This can be the next Office Communicator Kille…

The Basics of writing a Apex Trigger

One of the most important and common asked question on Forums and everywhere is how do I write a trigger. Coding in Apex Trigger is like going to a dentist for a root canal, you keep dreading the moment until you realize it is actually not going to hurt you. If you plan to write an Apex Trigger this quick guide will help you doing so.

The first and foremost rule in writing a trigger is to remember the oldest suggestion given to the most comprehensive Hitchhikers Guide to Galaxy, 'Don't Panic.' Writing a trigger is not a rocket science, in-fact we should thank the team at Salesforce and ForceDotCom for making everything so simple, that anyone can do it.

Enough of talk, lets code.

So you want to write a trigger. Let us have a glimpse of what we are going to build. The problem statement is as follows

Problem: When the User is entering the Opportunity, check for the Opportunity Amount. If the Opportunity Amount is greater than 50,000. Mark the Parent Account as 'Featured&#…