• WHO WE ARE
  • WHAT WE DO
    • Salesforce
      • Implementations
        • Sales Cloud
        • Service Cloud
        • CPQ
        • Field Service Lightning
        • Field Service for SMEs
      • Developments
        • Salesforce Customization
        • Custom Application Development
        • AppExchange Product Development
      • Migrations
        • Classic to Lightning Migration
        • Other Systems to Salesforce Migration
      • Integrations
    • Data Science
      • BI Solutions
      • AI/ML solutions
      • Agentic AI
  • HOW WE DO
    • Delivery Model
    • Our Works
  • REACH US
    • Contact Us
    • Careers
  • BLOG
    • WHO WE ARE
    • WHAT WE DO
      • Salesforce
        • Implementations
          • Sales Cloud
          • Service Cloud
          • CPQ
          • Field Service Lightning
          • Field Service for SMEs
        • Developments
          • Salesforce Customization
          • Custom Application Development
          • AppExchange Product Development
        • Migrations
          • Classic to Lightning Migration
          • Other Systems to Salesforce Migration
        • Integrations
      • Data Science
        • BI Solutions
        • AI/ML solutions
        • Agentic AI
    • HOW WE DO
      • Delivery Model
      • Our Works
    • REACH US
      • Contact Us
      • Careers
    • BLOG
  • [email protected]
  • (+91) 44-49521562
Merfantz - Salesforce Solutions for SMEs
Merfantz - Salesforce Solutions for SMEs
  • WHO WE ARE
  • WHAT WE DO
    • Salesforce
      • Implementations
        • Sales Cloud
        • Service Cloud
        • CPQ
        • Field Service Lightning
        • Field Service for SMEs
      • Developments
        • Salesforce Customization
        • Custom Application Development
        • AppExchange Product Development
      • Migrations
        • Classic to Lightning Migration
        • Other Systems to Salesforce Migration
      • Integrations
    • Data Science
      • BI Solutions
      • AI/ML solutions
      • Agentic AI
  • HOW WE DO
    • Delivery Model
    • Our Works
  • REACH US
    • Contact Us
    • Careers
  • BLOG

How to Get Tree View Structure Using Visualforce Page

  • August 1, 2017
  • Merfantz Editor
  • Salesforce Developments Tutorial
  • 0

Here, I mentioned the sample tree structure for a user with a profile using jquery. This is very helpful for the learner in Fieldax&Field Service Management Salesforce.

Visualforce code :-

<apex:page sidebar=”false” controller=”TestTreeView”>

<html>

<head>

</head>

<body>

<script src=”//cdnjs.cloudflare.com/ajax/libs/jquery/3.1.1/jquery.min.js”></script>

<link rel=”stylesheet” href=”//cdnjs.cloudflare.com/ajax/libs/jstree/3.3.3/themes/default/style.min.css” />

<script src=”//cdnjs.cloudflare.com/ajax/libs/jstree/3.3.3/jstree.min.js”></script>

<div id=”container”>

<ul>

<li>User

<apex:repeat value=”{!result}” var=”aa”>

<ul><li>{!aa}

<ul><li>{!result[aa]}</li></ul>

</li>

</ul>

</apex:repeat>

</li>

</ul>

</div>

<script>

$(function() {

$(‘#container’).jstree();

});

</script>

</body>

</html>

</apex:page>

Apex Code :-

public class TestTreeView{

public Map<String,Profile> mlis=new Map<String,Profile>();

Public Map<String,String> result{get;set;}

public Map<String,User> mlis1=new Map<String,User>();

//constructor

public TestTreeView(){

result=new Map<String,String>();

for(Profile p:[select name from Profile]){

mlis.put(p.name,p);

}

system.debug(‘cons list’+mlis);

system.debug(mlis.keyset());

for(User u:[select name,profile.name from user where profile.name in : mlis.keyset()]){

system.debug(‘cons list’+u);

result.put(u.name,u.profile.name);

}

system.debug(result);

}

}

We are the ISV Partners and Please reach us for custom development => www.merfantz.com

————————— Feel Happy ———————-

Author Bio

Merfantz Editor
+ Recent Posts
  • August 4, 2023
    How to Setup CRM Analytics for Financial Services Cloud
  • August 2, 2023
    How to Get Started with Salesforce Hyperforce - Merfantz
  • July 28, 2023
    Health Cloud Mastery: Salesforce Trailhead for Effective Healthcare CRM
  • July 26, 2023
    How to integrate Data cloud and Marketing cloud In Salesforce
Tags: Field Service ManagementFieldax
  • Previous How to Auto Sync Quote to Opportunity for Customer Approval
  • Next Business Process Built on Standard Salesforce Objects and Create a New Process

Leave a Reply

You must be logged in to post a comment.

Merfantz Technologies is a leading Salesforce consulting firm dedicated to helping small and medium enterprises transform their operations and achieve their goals through the use of the Salesforce platform. Contact us today to learn more about our services and how we can help your business thrive.

Discover More

Terms and Conditions
Privacy Policy
Cancellation & Refund Policy

Contact Info

  • No 96, 2nd Floor, Greeta Tech Park, VSI Industrial Estate, Perungudi, Chennai 600 096, Tamil Nadu, INDIA
  • (+91) 44-49521562
  • [email protected]
  • 9:30 IST - 18:30 IST

Latest Posts

Mastering Attachment Compression for Salesforce Developers May 9, 2025
Salesforce API Integrations: Connect with Slack, Zoom, and Teams May 2, 2025
Guide to Streamlining Sales Success
Mastering Salesforce CPQ: A Comprehensive Guide to Streamlining Sales Success April 17, 2025

Copyright @2023 Merfantz Technologies, All rights reserved