Saturday 22 December 2012

Salesforce Tips

#1. Taking up a Backup using ANT in Salesforce: 

While using ANT for taking backup from any org and get following error java.lang.OutOfMemoryError: Java heap space

Please update your bat file by this 
set ANT_OPTS=-Xmx1024m
ant -f build.xml -propertyfile build.properties -logger org.apache.tools.ant.listener.MailLogger
pause

#2. Auto Number feature in salesforce.: 
Auto Number Type field's value continuously gets increased in data creation in Test Class ( even it is test class data is virtual/temporary data) .it affects Auto number in organisation..

Wednesday 5 December 2012

Mass Edit profiles using Enhanced Profile List



It is very lengthy work to give permission of object to any profile and it becomes tedious when profiles come in 
hundreds.  

Here we will talk about editing profiles in bulk. Some time there are some cases where we need to modify object level permission for many profiles some time all profiles and it gets complicated if it is in 100s. 
Here is a way to edit all profiles at once.

1. Navigate : Setup>Manage Users > Profiles
2. Create a new list view 
3. Fill Name this list view let say "Test mass profile list view". Leave other setting as it is. In last section "Select Columns to Display" 
   you may select some column for easy to work on list view(it depends on your requirement).
4. Now your list view is ready to use.
   There are two way to work on this
   A) If you click edit link in "Action" column then profile gets open in edit mode
   B) If you want to change a specific permission of that object then ( please include this permission in to "Select Columns to Display" ) and then just you need to 
     double click over this and one small popup wizard will be opened where you can change it as per your need.

Wednesday 26 September 2012

Inline Editing in PageBlockTable


I was eager to know about inline editing in page-block table as we usually see on simple Native pages.so I studied about this decent feature of Salesforce and tried at my end as below:

I practiced with simple Sobject Account.


VF Page code:

  
      
                          
                
                
          
          
              
                  
                      
                          
                      
                  
                  
                      
                          
                      
                  
              
          
      
  

Controller code:
public class InlineEditing
{
   public List getListofAccounts()
   {
       List accTempList = new List([select id,Name,Industry from      Account order by LastModifiedDate ASC limit 5  ]);
       return accTempList;
   }
   public InlineEditing(ApexPages.standardController sc)
   {
       
   }
}
Thanks for visiting.

Thursday 13 September 2012

Cloud Trivia Winter#13

                Hi Techies, 


I played Cloudtrivia today and it was such amazing technical event I ever play.

Here some questions asked by forcedotcom for #cloudtrivia.


Q: What Object type now has dozens of new methods?
 Ans. String 
Q: What does the “exec” command do in the Command Line Window of the developer console? 
 Ans.      To execute query & generate log
Q: True/False: You can run tests using the Tests tool for any combination of classes you select (one, many, all, etc)? -
 Ans.   True
Q: As of #Winter13, there are now HTTP callouts for which two APIs?
Ans. Callout testing of SOAP and REST services
Q: Where can you now load test data from as of #Winter13? -
Ans. To load data from static resources(CSVs) for test classes
Q: Name 2 of the other new tools (besides Perspectives) added to the developer console in #Winter13? #cloudtrivia - 
Ans. Query Editor & Command Line
Q: What does “Perspectives” allow you to do in the developer console? #cloudtrivia - 
Ans. When you open a debug log in the Developer Console, it opens in a System Log view which is a collection of panels for analyzing the log. In the Winter ‘13 release, you can create perspectives in a System Log view.

Q: What set of tools will be piloted in #Winter13 to allow you to integrate external applications in Salesforce? 
Ans. Canvas
Q: What two formula functions were added for working with the beta Geolocation Custom Field type? 
Ans.  Distance & Geolocation
Q: Name 5 of the 7 chart types for Visualforce Charting? 
Ans. area, gauge, radar, scatter, bar
Q: What prefix should you use to “pass through” attributes in the <apex:outputPanel> component? Ans. - HTML



Thanks

Saturday 4 August 2012

How do I log a case to salesforce support

Hi friends,Very recently I needed to log a case in to salesforce. Here I am sharing way how i did it.


Step1. Click on "Help" link given on top of your org
Step2. Click on My Log ( button)
Step3. click on Log a Case Link
Step4. fill general enquiry form & submit.


In some other organization when you will click on Help you may be redirected to another web address so where you just need to click on "Contact Support" and then click on "Open a Case".

Sunday 5 February 2012

How to get List view Id without open it in edit mode

Hi friends !  Before some days I stuck in strange problem where I needed id of any List view of any Sobject. For this when I select List view from List. URL does't get refresh so I can't get id of currently selected list-view.
I came with a new way to find id of selected list view in alert Box( or by passing it in URl to show on VF page ) . I have created a custom button 'Get Id of ListView' (Behavior : Execute JavaScript,Display Type: List Button) on S-object whose List view id I have to get and wrote a bit of on-click javascript code:
var locationOfcurrentPage = location.href ; 
locationOfcurrentPage = locationOfcurrentPage.substring(locationOfcurrentPage.lastIndexOf('=')+1 , locationOfcurrentPage.length) ; 
var selectedListViewId = locationOfcurrentPage+'_listSelect'; 
var selectedoptionId = document.getElementById(selectedListViewId).value; 

alert('Selected List view option Id is   ' + document.getElementById(selectedListViewId).value  );
As Below image shows clearly that id in Url is same as in alert box (which I get from JS code snippet)
But when I change list view from'Test view'  to 'All' and now I can clearly observe that url doesn't get refresh but in alert Box I can get id of currently selected list view option.
Now you can enjoy with getting current id every time without going to  Edit mode.
Where you can use this code:
1.) To show list view on VF Page.
2.) To redirect again to same page  with last selected list view.

Friday 13 January 2012

Using Related List and Enhanced List on Same Page

I faced a problem when I needed to show enhacnedList and RelatedList on same VF-Page.
used snippet was as follows:









When I refresh Page I got salesforce Error as following:-

I could not find the proper solution of this problem only one solution I have right now to change its 
order of displaying.

When we keep RelatedList before enhancedList then page works fine.