Salesforce

Salesforce
Salesforce

Sunday, October 5, 2014

Graphical Representation of Last Activity Date


The Last Activity Date is a crucial information about an Account/Contact/Opportunity or a Lead record in salesforce. The system defined "Last Activity" field is not available on Page Layout, but available in Report, List View, and API (including Formula Field, Workflow and Validation Rule) for Account, Contact, Opportunity and Lead object.

In our different business scenarios, we prepare different reports based on the Last Activity date field, to do some analysis on a list of records.

Well, but what about if we are not looking at a list of records, instead we want to analyze an individual record?

Solution is simple, we can create a custom formula filed to auto populate the Last Activity date information, and populate the same custom formula filed on the page layout.


I propose a graphical representation of the Last Activity date information as below:















I hope you all find it interesting as it looks to me!


Following are the steps to achieve the above output:

1. Create a new custom formula field with “Text” formula return type.  
2. Put the following code into the formula syntax:

image("http://chart.apis.google.com/chart?cht=gom&chd=t:&chs=200x75&chco=00FF00,FFFF00,FF8040,FF0000&chxt=x,y&chxl=0:||1:|Recent|Old&chd=t:"&TEXT(Today() - LastActivityDate)&"&chl="& TEXT(Today() - LastActivityDate)&"+Days+Ago","Last Activity")

3. Finally include the same custom formula field on the page layouts.

Thanks.

Sunday, September 28, 2014

Handling Picklist (Multi-Select) field on Web-to-Lead


Sometime we use multi-select picklist fields on lead object to capture more than once choice submitted by our customers/prospects in response to certain questions.

A sample business scenario could be, if we ask our customers/prospects to respond which all our services they are interested in.

In salesforce if we use a Picklist (Multi-Select) field, that solves our purpose.






Now if we want the same information to be captured from a web page through the web-to-lead integration, we can simply generate the salesforce code for the multi-select picklist field.

However if we see the web form output for the multi-select picklist field, it doesn’t look so great and while filling the web form end user has to press the Ctrl key in order to select more than one choice.


















How about if on the web form we provide a user-friendly interface by replacing the multi-select picklist field with multiple check boxes? Sounds interesting! Isn’t it?













Okay, so if we want to achieve the above output on our web form, we need 3 additional check box fields in salesforce lead object in order to do the mapping with web-to-lead integration.

But NO, we are not going to create 3 fields, where we just needed one field in salesforce lead object.

Here is how we can map the salesforce multi-select picklist field with multiple checkboxes on the web form.

Replace your salesforce generated web-to-lead code for multi-select picklist field with below code.

Please specify your Interest Areas:

Salesforce Customization: <input  id="00NG000000ETZDd" name="00NG000000ETZDd" type="checkbox" value="Salesforce Customization" /><br>

Salesforce Development: <input  id="00NG000000ETZDd" name="00NG000000ETZDd" type="checkbox" value="Salesforce Development" /><br>

Salesforce Adoption: <input  id="00NG000000ETZDd" name="00NG000000ETZDd" type="checkbox" value="Salesforce Adoption" /><br>

The ID "00NG000000ETZDd" represents the API ID of salesforce multi-select picklist field.


Thanks.