Showing posts with label How To. Show all posts
Showing posts with label How To. Show all posts

Monday 7 April 2014

Salesforce Files Sync , The dropbox for Salesforce

16:39


Finally the wait is over…. Salesforce Files Sync is here… Its kinda like the Dropbox for salesforce and in Spring ’14 you can get it on pilot. Well lets go over some neat features
  • It syncs your files automatically to salesforce… just drop it and forget it
  • The files are available on all the devices
  • if you’ve shared the file on a chatter post, if the latest version is uploaded it automatically points to the latest version
  • Sits right in well with the files tab in salesforce
  • Decide which files to be synced
  • Control this feature via profiles and Permissions set (Users need to have the “Sync Files” permission)




How do I get it ?

Well as of spring ’14 You’ll need to contact salesforce support to enable this feature for you by raising a ticket.

Once its enabled for your ORG, make sure you give the “Sync Files” Permission to all those who need it. 

You can download the application from  : Your Name | My Settings | Desktop Add-Ons | Salesforce Files.

Limits 

Maximum Files folder size : 5GB
Maximum file size : 500 MB

Leave your thoughts in the comments

Read more about it : http://docs.releasenotes.salesforce.com/en-us/spring14/release-notes/rn_chatter_files.htm

Wednesday 9 October 2013

Describe all the fields for all SObjects

13:58
In one of the requirements I came across, I needed to get the list of all the fields across all objects. I wanted to make sure that I did in the best possible way, But couldn't find any straight answers. So here's the code I came up with. Its simple and straight-forward and if you find a better way to do this let me know in the comments. Thank you

To start off, we need the list of SObjects that we are going to run this for. Ideally we should have the list of SObjects stored in a Custom setting, this is a one time thing and could be done using anonymous apex execution. Following is the code to do just that..

List<string> SObjectList = new List<string>();

for(Schema.SObjectType objTyp : Schema.getGlobalDescribe().Values()){
   String name = objTyp.getDescribe().getName();
   // Exclude all the unwanted Sobjects e.g. History, Share etc..

 if(!name.containsignorecase('history') && !name.containsignorecase('tag')&&
    !name.containsignorecase('share') && !name.containsignorecase('feed')){      
      SobjectList.add(name);
  }
   // Insert into your custom settings
  }
Now that we've got the entire list of SObjects, lets do a Global Describe. Before we move on there is a gotcha here, as you know there is a governor limit on the number of Describes in an execution context (As of Winter '14 its 100 in both asynchronous and Synchronous) . I'll go ahead and suggest that its best if you could either do it in multiple executions or use a limit to control the number of SObjects processed.

 
      SObjectFieldsMap = new Map<string,Set<string>> ();
      Map<String, Schema.SObjectType> GlobalDescribe = new Map<String, Schema.SObjectType>();
      // Get the Global Describe which contains details for all objects
      GlobalDescribe =Schema.getGlobalDescribe();

      // Now we loop through our pre-compiled list of SObjects and get the describes for it
      for(String sObj:SObjectList)
      {
       // Populate the Map, with Sobject => list of fields
       if(SObjectFieldsMap.get(Sobj)==null && GlobalDescribe.get(sObj)!=null)
        SObjectFieldsMap.put(sObj,new Set<string>());

        if(SObjectFieldsMap.get(sObj)!=null) // Some Objects may not have Describes 
        SObjectFieldsMap.get(sObj).addAll(GlobalDescribe.get(sObj).getDescribe().fields.getMap().keyset());
      }
      
Well thats pretty much it. Hope this helps, let me know if you need anymore clarifications on this or if you've got some thoughts on this. Happy Coding!

Saturday 11 May 2013

<apex:actionStatus>

03:10
Action status is usually used to show the status of an Ajax Process to which it is related to. It can be as simple as showing text during the update to as fancy as greying out the page and showing a loading gif. your imagination (and HTML CSS skills) are the limits

Wednesday 24 April 2013

How to activate Summer ’13 Preview on sandbox

10:18
Summer 13The salesforce.com Summer ‘13 release is quickly approaching and soon you'll be able to take advantage of exciting new features and functionality! If you are a Force.com Sandbox customer, you have the opportunity to get early access to Summer ‘13 in your Sandbox and test new customization and features (the chance to get your feet wet) before your production organization is upgraded.




Tuesday 23 April 2013

Escalate Question to Case

18:11

AnswersThis is a very useful need at times requested by clients.  “Escalate Question to Case” / “Create Case from a question” / “Convert Question to case” in either customer portal , Partner portal, or any self serve portal.

In the answers portal, when we are required to Escalate the question to a case so that the executives can handle it. Salesforce provides this functionality internally but its a little tricky to turn it on and in this post I want to address this.

Wednesday 23 January 2013

Reload Standard Detail page from Inline VF

07:58
 
visualforceI just faced a small block, Pretty simple once you've figured it out, Thought of sharing it and saving time for us in the future. Most of the time we require to reload the Standard Page following an  action on the inline VF Page. The solution to this was not apparently available to me when I needed it. Usually after clicking on a link or button we need to refresh the standard (parent page) the VF page is in. Read more on how to add inline VF Pages

Problem: A VF page is inline on a standard detail Page, On click of button inside VF Page, Reload the standard Detail Page once action completes in the Inline VF page

Thursday 10 January 2013

How to write Batch Class in Salesforce.com Apex

10:00

batchApexIn order for us to write batch classes in apex, let us 1st understand what is batch class , when and where it should be used? This is an extensive blog going into details.
Main sections of this post are
  1. What is batch Apex
  2. When to use batch apex
  3. Advantages of using batch apex
  4. Batch Apex Governor limits
  5. Sample Code