Friday, January 24, 2014

Related list Hover Links on Custom VF page

Due to some hard constraints, some time we have overridden the Detail page with a VF page that uses the apex:detail tag with relatedList = false.  To display the related lists selectively to profiles

 One of the lacking features with this approach is that you no longer have the hover links for the related lists at the top of the page.  

Un-managed Package :


Ø  The requirement is to show the hover links like standard detail page on an override VF page. To cater the requirement I have developed two VF components. First one is for the header part which will initialize the hover link section and the second one will show & register the hover links associated with the object in a user defined order.

Ø  I have used custom setting to store the configuration of the hover links.  As of now and as clarified in the requirement hover links are same for all the users but it can be easily configured for profile level as well as for user level.

Ø  I have also given an UI to modify the order in which the hover links will appear as well as the component can be reused for any other object with proper custom setting configuration


Ø  Salesforce standard functions is been used to archive the requirement, for that source code of rendering the hovering link is used according to our needs. 

Ø  I have used JavaScript remoting along with JQuery ,Bootstrap 3 & Datatable to provide an easy UI to manipulate the order of the hover links


1.1      Components


  

1.1.1     Custom Setting

Serial No
Name
Description
       
Hover_Config__c
This will hold the configuration for a particular object

1.1.2     Apex Component

Serial No
Name
Description
        
HoverHeader
Component will register the Link component with Page
.      
HoverFooter
Component will register the related list need to be shown on the UI. and show the hover links in a predefined manner

1.1.3     Visualforce page

Serial No
Name
Description
        
AccountDetail
Sample demo of account override
        
OpportunityDetail
Sample demo for Opportunity override
       
ConfigEdit


1.1.4     Apex Class

Serial No
Name
Description
        
ConfigEditController
Controller class for the Edit UI of config
        
HoverFooterController
Controller for the HoverFooter Component
        
TESTAppController
Test class for the application


 Demo video 


Application ZIP