Salesforce Tips & Tricks

  1. Date format Techniques
  2. Date Format in Report/View: 6/20/2010 3:00 PM
    Date Syntax in Apex/API: 2010-06-20T00:00:00.000Z

  3. Interesting facts about Chatter
  4. You can post only 1000 characters, which is more than sufficient
    You can follow up to 500 people/records only
    You can join up to 100 groups
    You can create 10,000 groups in an organization
    You can mention only 10 members names in a single post

  5. How to achieve where clause of field1 = field2
    You might wanted to bring your records like Select id from Account where Column1 = Column2, which is not possible really in salesforce.

    Workaround for this is just create a formula field as Text and then populate this field as TRUE if the column1 = column2 else populate the value as FALSE and finally you can write a query as
    select id from Account where formulafield = ‘TRUE’

  6. Displaying more records in related list via appending a simple tag in the URL rowsperlist=#
    Example: https://na1.salesforce.com/001x0000002JRnd?rowsperlist=10

  7. View/Query/Report Performance Tip
    Instead of filtering the views/reports by the Name field, filter by Alias. A Name search requires searching two fields, whereas Alias only searches one.

  8. How to determine the mobile device in Apex
    When you login through your mobile there is a parameter USER-AGENT which passed in the URL, using this you can redirect users to specific pages.
    Code Snippet:
    String userAgent = ApexPages.currentPage().getHeaders().get(‘USER-AGENT’);
    if(userAgent.contains(‘iPhone’)) deviceType = ‘iPhone’;{//Your iphone code goes here}
    else if(userAgent.contains(‘BlackBerry’)) deviceType = ‘BlackBerry’;{//Your blackberry code goes here}

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s