Salesforce Navigation with Bootstrap, Visualforce and APEX

[easy-social-share counters=1 total_counter_pos="leftbig"]
Salesforce Navigation with Bootstrap, Visualforce and APEX

Visualforce provides a number of components out of the box to easily present your data to end users. Occasionally you may want to leverage a framework like Bootstrap and other third party libraries to create a pixel perfect experience.

How do you access navigation to include within the page? The following is a snippet that I used in a recent project and you may find useful to get kickstarted on your awesome UI!

Sample Result with Bootstrap

bootstrap-sample

APEX – JMBDashboard.cls

public with sharing class JMBDashboard {

	// Code from https://www.salesforce.com/us/developer/docs/apexcode/Content/apex_dynamic_describeTabs.htm
	// Get tab set describes for each app
	List tabSetDesc = Schema.describeTabs();

	public class TabLinks {
		public String linkname {
			get {return linkname; }
			set {linkname = value; }						
		}
		public String linkurl {
			get {return linkurl; }
			set {linkurl = value; }						
		}		
	}

	public static List getTabs() {
		
		List appTabs = new List();
				
		Schema.DescribeTabSetResult[] tabSetDesc = Schema.describeTabs();
				
		// Iterate through each tab set describe for each app and display the info
		for(DescribeTabSetResult tsr : tabSetDesc) {
		    String appLabel = tsr.getLabel();
		    System.debug('Label: ' + appLabel);
		    System.debug('Logo URL: ' + tsr.getLogoUrl());
		    System.debug('isSelected: ' + tsr.isSelected());
		    String ns = tsr.getNamespace();
		    if (ns == '') {
		        System.debug('The ' + appLabel + ' app has no namespace defined.');
		    }
		    else {
		        System.debug('Namespace: ' + ns);
		    }
		    
		    // Display tab info for the Sales app
		    // replace with your app name here
		    if (appLabel == 'My Performance') {
		        List tabDesc = tsr.getTabs();
		        System.debug('-- Tab information for the Sales app --');
		        for(Schema.DescribeTabResult tr : tabDesc) {
		            TabLinks myDetail = new TabLinks();		            
		            myDetail.linkname = tr.getLabel();
		            myDetail.linkurl = tr.getUrl();
		            appTabs.add(myDetail);
		        }
		        
		        return appTabs;
		    }            
		}
		
		return appTabs;
	}
}

Visualforce – JMBDashboard.page

With a little bit of effort, you can leverage the “Fixed Top” navigation Bootstrap example by including the following between the ul tags (e.g. <ul class=”nav navbar-nav”>).



...


	
  • {!tab.linkname}
  • ...

    20 Comments

    1. RashaGamal 4 years ago
    2. propackers820 4 years ago
    3. paperoni 3 years ago

      thanks .The snippet was of great help

      Regards
      rohit
      http://www.paperoni.in

    4. SachinAgarwal 3 years ago

      Packers and Movers Gurgaon – http://getpackers.com/packers-and-movers-gurgaon/
      Packers and Movers Gurgaon Charges – http://getpackers.com/packers-and-movers-gurgaon/
      Packers and Movers Gurgaon Rates – http://getpackers.com/packers-and-movers-gurgaon/
      Packers and Movers Gurgaon List – http://getpackers.com/packers-and-movers-gurgaon/
      Local Packers and Movers Gurgaon – http://getpackers.com/packers-and-movers-gurgaon/
      Movers and Packers Gurgaon – http://getpackers.com/packers-and-movers-gurgaon/
      Packers and Movers in Gurgaon – http://getpackers.com/packers-and-movers-gurgaon/
      Movers and Packers in Gurgaon – http://getpackers.com/packers-and-movers-gurgaon/
      Gurgaon Packers and Movers – http://getpackers.com/packers-and-movers-gurgaon/
      Gurgaon Movers and Packers – http://getpackers.com/packers-and-movers-gurgaon/
      Packers and Movers Gurgaon to Bangalore – http://getpackers.com/packers-and-movers-gurgaon/
      Packers and Movers Gurgaon to Pune – http://getpackers.com/packers-and-movers-gurgaon/
      Packers and Movers Gurgaon to Mumbai – http://getpackers.com/packers-and-movers-gurgaon/
      Packers and Movers Gurgaon to Hyderabad – http://getpackers.com/packers-and-movers-gurgaon/
      Packers and Movers Gurgaon to Kolkata – http://getpackers.com/packers-and-movers-gurgaon/
      Packers and Movers Gurgaon to Chennai – http://getpackers.com/packers-and-movers-gurgaon/

    5. marwam503 3 years ago

      شركة المدينة من افضل الشركات فى مجال التظيف الشامل بالمدينة المنورة كما
      انها تقوم بمكافحة الحشرات بالمدينة المنورة باعلى كفاءة ممكن وايضا نقل
      العفش من المدينة المنورة الى اي مكان
      بالممملكة
      http://almdinaa.com/

    6. sherazshazi 3 years ago

      It makes you a vibe thoroughly singing, dynamic, helped, and
      new for the length of the day.
      #If you wish to overhaul the appearance and soundness of
      your muscles then set the ahead of time said supplement with AndroNox which is a nitric oxide
      promoter. If you use these things together then you can expect speedier and
      whole plan happens. Regardless, before you use it essentially have an expedient
      look at the second supplement of this combo.
      Step 2-AndroNox
      Considered as a solid and a choice weight get prepared
      supplement, AndroNox affirmations to
      raise the diminished level of NO-nitric oxide in the body. The high NO level
      will help you to feel fortified and new for the length of the day allowing you
      to accumulate tore, balanced, and astounding structure. With the help of this
      supplement, you can truly save yourself from after-workout crashes. Additionally,
      it will help with speedier muscle change that you will achieve since couple of
      years. 

      http://www.potentmuscles.com/andronox-reviews/

    7. marykocha20 3 years ago

      TESTABLE LABEL CLAIMS:
      Vasodilation [an expansion of the internal diameter of blood
      vessels]
      Increased blood flow to skeletal muscle
      Increased oxygen transport to skeletal muscle
      Increased delivery of nutrients to skeletal muscle
      Reduction in blood pressure.
      Increased strength and markedly improved stamina
      Extended muscular pump
      Signaling muscle growth and speeding recovery
      Target tissues saturated with more consistent levels of
      desired nutrients and extending benefits [over a 10 hour period]

      https://liquidsteelmaleenhancementscam.wordpress.com/2016/10/02/cognidepth-brain-enhancing-drugs/

    8. CynthiaLara 3 years ago

      Another thing I did find was one supposed “review” ofon youtube, check it out below:
      However, what’s interesting to note is that this guy is a
      paid reviewer who is endorsing this product for a price.  How do I know this???  Check out the image below…

      https://probioticsscientifictesting.wordpress.com/2016/10/02/cognidepth-intelligent-capsule/

    9. ayashamalik1 3 years ago

      Your manhood will get a raise, and you will be able to feel
      this change is driven to have sex and become a beast in bed urgency. This
      supplement has been proven effective in removing fat from the body and make the
      body took place in a very quick period of time. Get lean muscle development
      very quickly with and
      makes you look like a real macho muscle and the press. Making six packs of your
      belly is very simple with .
      Demands

      http://exoslimbayshram.uzblog.net/how-can-exoslim-work-786523
      http://exoslimbayshram.blogrip.com/
      http://exoslimfaq.mysitezulu.com/
      http://etiquetteofexoslim.weebly.com/
      http://exoslim-the-easy-way.jigsy.com/

    10. ShshaKamal 2 years ago

      Allison . although Jonathan `s postlng is something… last monday I bought themselves a Lotus Elise from having earned $7296 this past four weeks and-just over, 10 grand last month . it’s realy the most rewarding I have ever done . I started this 5 months ago and immediately began to bring in at least $78, per hour . visit,’-,-;,-,;,-,; online.jobs14.com

    11. gohar7885 2 years ago

      <a href=”http://www.happyvalentinesday2k17.com”></a>
      <a href=”http://www.happyvalentinesday2k17.com/2016/11/valentines-day-2017-wishes.html”>happy valentines day 2017 wishes</a>

      <a href=”http://www.happyvalentinesday2k17.com/2016/11/happy-valentines-2017-images.html”>happy valentines day 2017 images</a>

      <a href=”http://www.happyvalentinesday2k17.com/2016/11/happy-valentines-day-quotes-2017.html”>happy valentines day quotes 2017</a>

    12. samarthagencies46 2 years ago

      happy valentines day quotes 2017

      http://valentinesdayspecialist.blogspot.in/      
      http://valentinesdayspecialist.blogspot.com/p/rose-day-messages.html                  
      http://valentinesdayspecialist.blogspot.com/p/rose-day-images.html                    
      http://valentinesdayspecialist.blogspot.in/2016/12/rose-day.html                  

      http://valentinesdayspecialist.blogspot.in/p/propose-day-messages.html                    
      http://valentinesdayspecialist.blogspot.com/p/propose-day-images.html                    
      http://valentinesdayspecialist.blogspot.com/2016/12/propose-day.html                    

      http://valentinesdayspecialist.blogspot.in/p/chocolate-day-messages.html                    
      http://valentinesdayspecialist.blogspot.com/p/chocolate-day-images.html                    
      http://valentinesdayspecialist.blogspot.com/2016/12/chocolate-day.html                   

      http://valentinesdayspecialist.blogspot.com/p/teddy-day-messages.html                    
      http://valentinesdayspecialist.blogspot.com/p/teddy-day-images.html                    
      http://valentinesdayspecialist.blogspot.com/2016/12/teddy-day.html                   

      http://valentinesdayspecialist.blogspot.com/p/promise-day-messages.html                    
      http://valentinesdayspecialist.blogspot.com/p/promise-day-images.html                    
      http://valentinesdayspecialist.blogspot.com/2016/12/promise-day.html                   

      http://valentinesdayspecialist.blogspot.com/p/kiss-day-messages.html                    
      http://valentinesdayspecialist.blogspot.com/p/kiss-day-images.html                   
      http://valentinesdayspecialist.blogspot.com/2016/12/kiss-day.html                    

      http://valentinesdayspecialist.blogspot.com/p/hug-day-messages.html                    
      http://valentinesdayspecialist.blogspot.com/p/hug-day-images.html                    
      http://valentinesdayspecialist.blogspot.com/2016/12/hug-day.html                   

      http://valentinesdayspecialist.blogspot.com/2016/12/history-of-valentines-day-valentines.html                   
      http://valentinesdayspecialist.blogspot.com/2016/12/valentines-week-list.html

    13. imtheonly1canutrustme 2 years ago

      http://whatsapphindifunnyjokes.blogspot.in/2016/08/good-morning-images-for-whatsapp.html?m=1
      http://whatsapphindifunnyjokes.blogspot.in/2016/01/1000whatsapp-jokes-images-2016whatsapp.html
      http://whatsapphindifunnyjokes.blogspot.in/2016/09/whatsapp-status-2016-status-for.html
      http://whatsapphindifunnyjokes.blogspot.in/2016/02/100-whatsapp-troll-dp-fb-images.html?m=1
      http://whatsapphindifunnyjokes.blogspot.in/2016/09/punjabi-status-for-whatsapp-2016.html?m=1
      http://whatsapphindifunnyjokes.blogspot.in/2016/09/good-night-jokes-funny-good-night.html?m=1
      http://whatsapphindifunnyjokes.blogspot.in/2016/01/1000i-miss-u-message-sms-free-download.html?m=1
      http://whatsapphindifunnyjokes.blogspot.in/2015/08/385-sad-love-hurts-sms-massage-status.html
      http://whatsapphindifunnyjokes.blogspot.in/2016/09/whatsapp-status-2016-status-for.html
      http://whatsapphindifunnyjokes.blogspot.in/2015/09/43-whatsapp-hindi-funny-jokes.html
      http://whatsapphindifunnyjokes.blogspot.in/2016/09/whatsapp-status-2016-status-for.html
      http://whatsapphindifunnyjokes.blogspot.in/2016/07/jokes-funny-hindi-very-funny-joke-in.html?m=1
      http://whatsapphindifunnyjokes.blogspot.in/2016/10/funny-images-funny-pics-for-whatsapp.html?m=1
      http://whatsapphindifunnyjokes.blogspot.in/2015/09/43-whatsapp-hindi-funny-jokes.html?m=1
      http://whatsapphindifunnyjokes.blogspot.in/2016/10/status-in-marathi-marathi-whatsapp.html
      http://whatsapphindifunnyjokes.blogspot.in/2016/09/top-50-high-attitude-whatsapp-status-in.html?m=1
      http://whatsapphindifunnyjokes.blogspot.in/2016/10/santa-banta-jokes-santa-banta-jokes-in.html
      http://whatsapphindifunnyjokes.blogspot.in/2016/01/1000-hindi-shayari-imagehindi-love.html
      http://whatsapphindifunnyjokes.blogspot.in/2016/08/good-night-images-good-night-wallpaper.html?m=1
      http://whatsapphindifunnyjokes.blogspot.in/2016/01/ias-interview-questions-and-answers.html?m=1
      http://whatsapphindifunnyjokes.blogspot.in/2016/07/funny-jokes-in-english-for-school.html?m=1
      http://whatsapphindifunnyjokes.blogspot.in/2016/01/1000-hindi-shayari-imagehindi-love.html?m=1
      http://whatsapphindifunnyjokes.blogspot.in/2016/09/whatsapp-status-sad-2016-sad-whatsapp.html?m=1
      http://whatsapphindifunnyjokes.blogspot.in/2016/09/top-sad-love-shayari-images-download.html?m=1
      http://whatsapphindifunnyjokes.blogspot.in/2015/09/25-ultiate-hindi-love-status-massages.html?m=1
      http://whatsapphindifunnyjokes.blogspot.in/2016/01/1000quotes-picture-inspirational.html?m=1
      http://whatsapphindifunnyjokes.blogspot.in/2015/12/1000-love-status-in-hindi-for-whatsapp.html?m=1
      http://whatsapphindifunnyjokes.blogspot.in/2016/09/top-sad-love-shayari-images-download.html?m=1
      http://whatsapphindifunnyjokes.blogspot.in/2016/01/1000funny-friendship-status-best-funny.html?m=1
      http://whatsapphindifunnyjokes.blogspot.in/2016/01/whatsapp-funny-photos-images-pictures.html?m=1
      http://whatsapphindifunnyjokes.blogspot.in/2016/09/punjabi-status-for-whatsapp-2016.html?m=1
      http://whatsapphindifunnyjokes.blogspot.in/2016/09/punjabi-status-for-whatsapp-2016.html?m=1
      http://whatsapphindifunnyjokes.blogspot.in/2016/09/whatsapp-status-2016-status-for.html?m=1
      http://whatsapphindifunnyjokes.blogspot.in/2016/09/punjabi-status-for-whatsapp-2016.html
      http://whatsapphindifunnyjokes.blogspot.in/2015/10/friendship-sms-friendship-day-massages.html 
      http://whatsapphindifunnyjokes.blogspot.in/2016/09/best-100-hindi-status-for-life-quotes.html?m=1
      http://whatsapphindifunnyjokes.blogspot.in/2016/09/whatsapp-status-2016-status-for.html?m=1
      http://whatsapphindifunnyjokes.blogspot.in/2016/09/whatsapp-status-2016-status-for.html?m=1
      http://whatsapphindifunnyjokes.blogspot.in/2016/10/status-in-marathi-marathi-whatsapp.html
      http://whatsapphindifunnyjokes.blogspot.in/2015/08/385-sad-love-hurts-sms-massage-status.html
      http://whatsapphindifunnyjokes.blogspot.in/2016/09/whatsapp-status-2016-status-for.html?m=1
      http://whatsapphindifunnyjokes.blogspot.in/2016/01/1000-hindi-shayari-imagehindi-love.html?m=1
      http://whatsapphindifunnyjokes.blogspot.in/2016/09/top-50-high-attitude-whatsapp-status-in.html?m=1
      http://whatsapphindifunnyjokes.blogspot.in/2016/01/gujarati-love-shayarigujarati-love.html?m=1
      http://whatsapphindifunnyjokes.blogspot.in/2016/10/friendship-sms-marathi-languagemarathi.html?m=1
      http://whatsapphindifunnyjokes.blogspot.in/2016/01/1000good-night-shayari-images-hd.html?m=1
      http://whatsapphindifunnyjokes.blogspot.in/2016/07/funny-whatsapp-status.html
      http://whatsapphindifunnyjokes.blogspot.in/2016/05/sad-beautiful-quotes-beautiful-sad-love.html?m=1
      http://whatsapphindifunnyjokes.blogspot.in/2016/01/1000power-of-your-mind.html?m=1
      http://whatsapphindifunnyjokes.blogspot.com/2016/07/funny-whatsapp-status.html
      http://whatsapphindifunnyjokes.blogspot.in/2016/06/dil-ke-liye-dard-bhi-shayari2017-best.html
      http://whatsapphindifunnyjokes.blogspot.in/2016/10/chutkule-chutkule-in-hindichutkule.html?m=1
      http://whatsapphindifunnyjokes.blogspot.in/2016/10/chutkule-chutkule-in-hindichutkule.html?m=1
      http://whatsapphindifunnyjokes.blogspot.in/2016/07/new-marathi-jokes-very-funniest-marathi.html?m=1
      http://whatsapphindifunnyjokes.blogspot.in/2016/09/nice-day-sms-jokes-nice-jokes-in-hindi.html
      http://whatsapphindifunnyjokes.blogspot.in/2016/10/funny-jokes-100-words-very-funny-sms-in.html
      http://whatsapphindifunnyjokes.blogspot.in/2015/08/top-255-happy-birthday-sms-wishes.html
      http://whatsapphindifunnyjokes.blogspot.in/2016/01/1000i-miss-u-message-sms-free-download.html?m=1
      http://whatsapphindifunnyjokes.blogspot.in/2016/07/jokes-funny-hindi-very-funny-joke-in.html?m=1
      http://whatsapphindifunnyjokes.blogspot.in/2015/10/65.html?m=1 
      http://whatsapphindifunnyjokes.blogspot.in/2016/10/mast-jokes-mast-joke-for-whatsapp-mast.html
      http://whatsapphindifunnyjokes.blogspot.in/2016/07/jokes-sms-funny.html
      http://whatsapphindifunnyjokes.blogspot.in/2016/10/santa-banta-jokes-santa-banta-jokes-in.html
      http://whatsapphindifunnyjokes.blogspot.in/2016/07/sardarji-jokes-in-kannada.html
      http://whatsapphindifunnyjokes.blogspot.in/2016/09/sms-jokes-funny-sms-joke-msg-for.html
      http://whatsapphindifunnyjokes.blogspot.in/2016/09/cool-sms-jokes-cool-sms-for-girlfriend_27.html
      http://whatsapphindifunnyjokes.blogspot.in/2016/07/funny-jokes-in-hindi-on-husband-and-wife.html?m=1
      http://whatsapphindifunnyjokes.blogspot.in/2016/09/funny-love-sms-for-girlfriend-love-joke.html?m=1
      http://whatsapphindifunnyjokes.blogspot.in/2016/09/funny-shayari-funny-shayri-on.html?m=1
      http://whatsapphindifunnyjokes.blogspot.in/2016/01/1000-hindi-shayari-imagehindi-love.html?m=1
      http://whatsapphindifunnyjokes.blogspot.in/2016/08/funny-jokes-funny-jokes-images-pictures.html?m=1

    Leave a reply

    Your email address will not be published. Required fields are marked *

    *