^ Click Here

Wednesday, June 29, 2011

Understanding the CRM workflow Account, Contact, opportunity and Leads

Disclaimer : The ideas are of my own and they might not be technically correct, It's mostly for understanding and not to be relied upon.
Q:What is an Account??

Account is actually an entity with which the concerned is having Business, It could be A company, A firm, A small group.

Q:What is a Contact

Contact is usually a person with whom we are dealing with, A contact is attached to and represent an Account.

Q:What is an Opportunity?

Opportunity is the the available business prospects for the concerned.

Q:What is a Lead?

A lead is one entity which can turn out into a usually long term business Activity. In normal business process a lead when confirmed is converted into an
Account, a Contact and an opportunity.

Now let's understand it by an example.

Suppose I have a business of Stationary products (Paper, pens, pencils etc.). Currently I am providing stationary items in two companies A and B. The person
A-first from the company A asked me for a consignment for his team-members. Also another person A-second from the same company A calls me for another
consignment for the staffs who works under him.

Now here the company A and B are the two Accounts and the person A-first and A-second are the contacts who belongs to the Account A. the consignments which
both the contacts asked for are the two Opportunities.

Now one fine day a friend of mine give me the phone number of a person C-first from the Company C who is probably looking for someone who can provide a
huge consignment.

here I got a Lead with whom I can have a business deal.

I called him and after much haggling I got the order for one more consignment, Then the lead is converted into an Account(C), a contact(C-first) and an
Opportunity (the order for consignment).

In 2 days I provided the consignment for A-first and got the payment Hence the Opportunity from A-first is Closed But I still have two open
opportunities
(from A-second and C-first).

These were the very basic of business process flow in CRM. I hope it would have been useful in clarifying the ideas


Sunday, June 5, 2011

How to get date and datetime as string in desired format in salesforce.

(I am sure there would be other methods, but one which worked for me( I didn't look further). you need to get a date to use in dynamic query.)

//Create a datetime
Datetime dtDate = Datetime.newinstanceGmt(2011,5,21,0,0,0);

// Change the format according to your need and get the date as a string
string dateCh = dtDate.format('yyyy-MM-dd');

string otherdate = dtDate.format('dd-MM-yyyy');

(this was no big deal but if you need to get a datetime for a query(SOQL) this method would be very useful.)

string cdDateCh = dtDate.format('yyyy-MM-dd\'T\'HH:mm:ss\'Z\'');

ex.-

List = [select name, Account.name from Contact where createdDate > :cdDateCh];