Help Center
  • What is GridMate
  • 📌Getting Started
    • Package Setup
    • Appexchange
  • 🎬Product Tour
    • Related List Grid
    • Parent Related List Grid
    • List View Grid
    • Kanban List View Grid
    • Kanban Board
    • Field Set Grid
    • User Grid
    • Pivot Grid
    • Report Table
    • Multi Calendar
    • Single Calendar
    • Object Timeline
    • File Explorer
    • Record Layout
    • Record KPI
    • Field Path
    • Map Record
    • Map List
    • Utility Bar Grid
    • Record App Switcher
    • Flow Grids
    • Compact Calendar
  • 🚀Advanced Guides
    • Grid - Advanced Configuration
    • Grid - Mass/Record Actions
    • Grid - Advanced Filtering
    • Grid - Inline Components
    • Grid - Mass Edit Button
    • Grid - Enhanced Filter Builder
    • Grid - Data Import Wizard
    • Grid - Dynamic Formula Field
    • Grid - Grid Explorer
    • Grid - Dynamic Interaction
    • Grid - Dynamic FieldSet Grid
    • Grid - Dynamic Record Card
    • Grid - Custom Action
    • Grid - Interactive Filters
    • Grid - Bulk Action
    • Grid - Custom Inline Component
    • Grid - Config Checker
    • Grid - Admin Cockpit
    • User Grid - Split View
    • User Grid - Data Filtering
    • User Grid - Deployment Process
    • Map List - Search Around Setup
    • Salesforce Classic Setup
  • 📦Package Reference
    • Components Library
      • GM - RelatedList Grid
      • GM - FieldSet Grid
      • GM - ListView Grid
      • GM - FieldSet Kanban
      • GM - ListView Kanban
      • GM - kanban Board
      • GM - Parent RelatedList Grid
      • GM - RelatedList Tabs
      • GM - RelatedList Accordion
      • GM - RelatedList Cards
      • GM - Record Layout
      • GM - Record Layout (LWC)
      • GM - Record Card
      • GM - Dynamic Tabs
      • GM - Dynamic Accordion
      • GM - Flow Layout
      • GM - Field Path
      • GM - Multi Calendar
      • GM - FieldSet Pivot
      • GM - Flow View Grid
      • GM - Flow Edit Grid
      • GM - Record App Switcher
      • GM - Map Record
      • GM - Map List
      • GM - Report Table
      • GM - Object Timeline
      • GM - User Grid
      • GM - File Explorer
      • GM - Dynamic FieldSet Grid
      • GM - Dynamic Record Card
      • GM - User Grid Split View
      • GM - Compact Calendar
      • GM - Interaction Logger
    • Javascript Formulas
    • DataGrid Settings
  • Tools
    • SF Cli Plugin
    • Chrome Extension
  • 📬TROUBLESHOOTING
    • ⚙️Config Snippets
      • Layout - basic setup
      • Layout with read only field
      • Layout with field visibility
      • Layout with section visibility
      • Layout with autocomplete
      • Inline FieldSet Grid
      • Inline RelatedList Grid
      • Inline Record Layout
      • Inline Chatter Feed
      • Multiple Inline Components
      • Calendar - Extra Activities
      • Field Path Stages
      • Dynamic Tabs
      • Compact Calendar
      • Object Timeline
    • ❓FAQ
  • 📋Release Notes
Powered by GitBook

Links

  • Appexchange
  • Pricing
  • Solution

Social

  • Youtube
  • LinkedIn
  • X

2025 GridMate

On this page
  • Lightning application setup
  • Visualforce page setup
  • Mass Edit button setup
  • Remote Site setup

Was this helpful?

  1. Advanced Guides

Salesforce Classic Setup

PreviousMap List - Search Around SetupNextComponents Library

Last updated 1 month ago

Was this helpful?

GridMate can be deployed on Salesforce Classic. Only RelatedList and ListView grids are supported. To run GridMate on Classic, we use Salesforce .

Lightning application setup

To run the Lightning out on Classic, a lightning app VFListViewDataGridApp should be created with the markup below.

<aura:application extends="ltng:outApp" >
    <aura:dependency resource="gmpkg:VFListViewDataGridComponent"/>
    <aura:dependency resource="markup://force:showToast" type="EVENT"/>
    <aura:dependency resource="markup://force:refreshView" type="EVENT"/>
</aura:application>

Visualforce page setup

Create a Visualforce page to wrap GridMate component using the Lightning out technology.

<apex:page controller="VFListViewDataGridController"
           showHeader="true"            
           sidebar="false">
    <apex:includeLightning />
    
    <div id="workbench" />
    
    <script>
    $Lightning.use("{!lightningApp}", function() {        
        //prepare attributes
        let attributes = JSON.parse('{!attributes}' || '{}');
        attributes = Object.assign(attributes, {
            "aura:id": "listViewGrid",
            "relatedObjectName" : "{!relatedObjectName}",
            "listViewName" : "{!listViewName}"
            "canFilter": true            
        });
        
        //create the data grid
        $Lightning.createComponent("gmpkg:VFListViewDataGridComponent",
                                   attributes,
                                   "workbench",
                                   function(component) {
                                       $A.eventService.addHandler({
                                           event: 'force:showToast',
                                           handler: function(event) { 
                                               let toast = component.find("toast");
                                               toast.showToast(event.getParams());
                                           }
                                       });
                                   });
    });        
    </script>
</apex:page>

We have also to implement the Visualforce controller with its unit test class

/***
* @author Hicham El Mansouri@GridMate
* @date 12/2019
* @description DataGrid controller class for VFListViewDataGrid.
*/
public with sharing class VFListViewDataGridController {
    private final String lightningApp;
    private final String relatedObjectName;
    private final String listViewName;
    private final String attributes;
    
    public VFListViewDataGridController() {
        lightningApp = ApexPages.currentPage().getParameters().get('c__lightningApp');
        relatedObjectName = ApexPages.currentPage().getParameters().get('c__object');
        attributes = ApexPages.currentPage().getParameters().get('c__attributes');
        
        listViewName = getLastUsedListView(relatedObjectName);
    }

    private static String getLastUsedListView(String objName)
    {
        try{
            RecentlyViewed recentItem = [Select Id, Name From RecentlyViewed  
                                         Where Type='ListView' Order by LastViewedDate Desc Limit 1];
            
            ListView listView = [Select Id, Name, DeveloperName From ListView 
                                 Where SobjectType=:objName And Name=:recentItem.Name Limit 1];
            
            return listView.DeveloperName;
        }        
        catch(Exception ex){
            System.debug(ex.getStackTraceString());
            return null;
        }           
    }
    
    public String getRelatedObjectName() {
        return relatedObjectName;
    }
    
    public String getAttributes() {
        return attributes;
    }
    
    public String getListViewName() {
        return listViewName;
    }       
    
    public String getLightningApp() {
        return lightningApp;
    } 
}
/***
* @author Hicham El Mansouri@GridMate
* @date 12/2019
* @description DataGrid controller class for VFListViewDataGrid.
*/
@isTest
public class VFListViewDataGridControllerTest {
    static testMethod void testGetLastUsedListView(){
        ApexPages.currentPage().getParameters().put('c__lightningApp', 'c:VFListViewDataGridApp');
        ApexPages.currentPage().getParameters().put('c__object', 'Account');
        ApexPages.currentPage().getParameters().put('c__attributes', '%7B"canCreate"%3A+true%2C"canClone"%3A+true%7D');
        
        VFListViewDataGridController c = new VFListViewDataGridController();
        
        String lastUsed = c.getListViewName();
        if(lastUsed == null){System.assert(lastUsed == null);}
        else{ System.assert(lastUsed != null);}
        
        String relatedObjectName = c.getRelatedObjectName();
        System.assert(relatedObjectName != null);
        
        String attributes = c.getAttributes();
        System.assert(attributes != null);
        
        String lightningApp = c.getLightningApp();
        System.assert(lightningApp != null);
    }
}

Mass Edit button setup

To trigger the mass edit Visualforce page, we have to configure a link on the targeted object.

{! URLFOR( "/apex/VFListViewDataGridPage?", null, 
[
  c__lightningApp='c:VFListViewDataGridApp',
  c__object='Account',
   c__attributes='{"canCreate":true,"canClone":true,"canFilter":true}'
]
)}

Mass Edit can be enabled on any object by duplicating the link below and changing the c__object parameter only.

The link should be added to the list of actions on a ListView.

Remote Site setup

GridMate uses API to fetch the ListView's metadata. Visualforce URL should be added to Remote Site Settings. See below

🚀
👇
Lightning out
Remote Site settings