Skip to main content

Latest Post

The Ego in the Machine: Is Our Need for Validation Creating an Existential Threat?

Technology has always been a bridge, but today, it feels more like a mirror. With the rapid rise of AI , we are seeing things enter our lives and leave them at a pace we can barely track. To understand where this is going, we first have to understand how technology actually impacts the core of who we are. The Survivalist vs. The Ego Our minds are biologically wired for one thing: survival . We are designed to handle the worst-case scenario, an ancient instinct gifted to us by nature. We consider ourselves conscious decision-makers, but a critical question remains: Who is really making the call?

Drag and drop, show and hide columns styling with SLDS Customize list view Visualforce Page and JQuery

Here is sample code for who wants drag and drop, Show and hide functionality in visualforce page using SLDS styling. In this code we are using JQuery, SLDS, Visualforce page.
Customize List View 
Sample Visualforce Page:- 
<apex:page showHeader="false" doctype="html-5.0"  sidebar="false" lightningStylesheets="true">

    <html xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" lang="en">
        <head>
            <!-- Import the Design System style sheet -->
            <apex:slds /> 
            <link rel="stylesheet" href="https://cdn.datatables.net/1.10.19/css/jquery.dataTables.min.css"/>
            <link rel="stylesheet" href="https://cdn.datatables.net/fixedheader/3.1.5/css/fixedHeader.dataTables.min.css"/>
            <link rel="stylesheet" href="https://cdn.datatables.net/buttons/1.5.6/css/buttons.dataTables.min.css"/>
            <style>              
                .slds-scope hr {
                display: block;
                margin: 0.5rem 0;
                border-top: 1px solid rgb(221, 219, 218);
                height: 1px;
                clear: both;
                }
                #data th, #pendingRequests th
                {
                background-color:#539fc6 !important ;
                color:white;
                vertical-align:middle;
                }
                #data tr td, #pendingRequests tr td
                {
                vertical-align:middle;
                }
                #link:hover{
                opacity: 1;
                background-color:#539fc6;
                }
                
                th{
                box-sizing: border-box;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;
                }
                
                <!-- add for dynamic column css -->
                .slds-scope .slds-icon-text-default {
                fill: rgb(255, 255, 255) !important;
                }
                button.dt-button.active {
                background: #539fc6 !important;
                color:white;
                font-weight: bold !important;
                }
                .dt-button-collection{
                width: auto !important;
                top: 35% !important;
                left: 4% !important;
                margin-left: 38% !important;
                position: fixed !important;
                margin-top: -175px !important;
                }
                .buttons-colvis {
                background: #539fc6 !important;
                color: white !important;
                font-weight: bold !important;
                }
                .dt-button-collection {
                max-height: 500px !important;
                overflow-y: auto !important;
                }
                .dt-buttons{
                margin-left: -14em !important;
                }
                .dataTables_length{
                margin-left: 5em !important;
                position:relative !important;
                z-index : 10;
                }
                .paginate_button.current{
                background: linear-gradient(to bottom, #fff 0%, #539fc6 100%) !important;
                }
                .slds-icon-eq__bar {
                background: #539fc6 !important;     
                } 
                .reset-button{
                background: #539fc6 !important;
                margin-left: 12em !important;
                color:white !important;
                padding: 9px !important;
                }      
            </style>
        </head>        
        <body>
            <apex:form >
                <div class="slds-scope slds-theme_shade slds-theme_alert-texture slds-form-element" style="min-height:96.5vh;background-color:white;padding:0px;margin:0px;">                    
                    <div class="container-fluid " id="tab-default-5"  style="background-color:white;border:0px solid #DCDCDC;">
                        <div class="slds-grid slds-gutters" style="margin-right: 2%;margin-left: 2%;">
                            <div style="padding: 0.5%;width: 142px; " class="slds-col">
                                <span Id="messageTitle"><span class="slds-icon_container slds-icon_container_circle slds-icon-action-flow" title="Description of icon when needed">
                                    <svg class="slds-icon slds-icon_small" aria-hidden="true">
                                        <use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="/apexpages/slds/latest/assets/icons/action-sprite/svg/symbols.svg#record"></use>
                                    </svg>
                                    <span class="slds-assistive-text">Description of icon when needed</span>
                                    </span>
                                    List Reocrds </span>                            
                                <apex:commandLink action="{!}" target="blank" styleClass="slds-button slds-button_brand" style="font-weight:bold;text-align:right;background-color:#539fc6;" >
                                    New 
                                </apex:commandLink>                            
                            </div>
                            <div style="padding: 0.5%;" class="slds-col">
                                <div class="slds-form-element__control">
                                    
                                </div>
                            </div>
                            <div class="slds-col" style="padding: 0.5%;">
                                <div class="slds-icon-eq slds-is-animated" style="left: 85%;top: 27%;" title="Progress of Requests">
                                    
                                    <div class="slds-icon-eq__bar"></div>
                                    <div class="slds-icon-eq__bar"></div>
                                    <div class="slds-icon-eq__bar"></div>
                                    <span class="slds-assistive-text">
                                    </span>
                                </div>
                            </div>
                        </div>
                        
                        <hr/>
                        <div  style="width:100%;padding-left:2%;padding-right:2%; overflow-x: scroll;" styleclass="slds-table slds-table_cell-buffer slds-table_bordered slds-table_striped">
                            <!--<span style = "font-size:16px;"> All Requests   </span><hr/>-->                            
                            <apex:outputPanel Id="RequestTable">
                                <table id="data" class="table-striped table-bordered display responsive nowrap" cellspacing="0" style="width:100%;table-layout:fixed">                               
                                    <thead>                                
                                        <tr>
                                            <th >
                                                <span class="slds-icon_container slds-icon-standard-opportunity slds-m-right_xx-small" title="Account">
                                                    <svg class="slds-icon slds-icon_x-small" aria-hidden="true">
                                                        <use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="/apexpages/slds/latest/assets/icons/standard-sprite/svg/symbols.svg#opportunity"></use>
                                                    </svg>
                                                    <span class="slds-assistive-text">Column 1</span>
                                                </span>
                                                Column 1
                                            </th>                                            
                                            <th >
                                                <span class="slds-icon_container slds-icon-standard-opportunity slds-m-right_xx-small" title="Account">
                                                    <svg class="slds-icon slds-icon_x-small" aria-hidden="true">
                                                        <use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="/apexpages/slds/latest/assets/icons/standard-sprite/svg/symbols.svg#call"></use>
                                                    </svg>
                                                    <span class="slds-assistive-text">Column 2</span>
                                                </span>
                                                Column 2
                                            </th>
                                            <th >
                                                <span class="slds-icon_container slds-icon-standard-opportunity slds-m-right_xx-small" title="Account">
                                                    <svg class="slds-icon slds-icon_x-small" aria-hidden="true">
                                                        <use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="/apexpages/slds/latest/assets/icons/standard-sprite/svg/symbols.svg#case"></use>
                                                    </svg>
                                                    <span class="slds-assistive-text">Column 3</span>
                                                </span>
                                                Column 3
                                            </th>
                                            <th >
                                                <span class="slds-icon_container slds-icon-standard-opportunity slds-m-right_xx-small" title="Account">
                                                    <svg class="slds-icon slds-icon_x-small" aria-hidden="true">
                                                        <use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="/apexpages/slds/latest/assets/icons/standard-sprite/svg/symbols.svg#chart"></use>
                                                    </svg>
                                                    <span class="slds-assistive-text">Column 4</span>
                                                </span>
                                                Column 4
                                            </th>
                                            <th >
                                                <span class="slds-icon_container slds-icon-standard-opportunity slds-m-right_xx-small" title="Account">
                                                    <svg class="slds-icon slds-icon_x-small" aria-hidden="true">
                                                        <use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="/apexpages/slds/latest/assets/icons/standard-sprite/svg/symbols.svg#coaching"></use>
                                                    </svg>
                                                    <span class="slds-assistive-text">Column 5</span>
                                                </span>
                                                Column 5
                                            </th>
                                            <th >
                                                <span class="slds-icon_container slds-icon-standard-opportunity slds-m-right_xx-small" title="Account">
                                                    <svg class="slds-icon slds-icon_x-small" aria-hidden="true">
                                                        <use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="/apexpages/slds/latest/assets/icons/standard-sprite/svg/symbols.svg#cms"></use>
                                                    </svg>
                                                    <span class="slds-assistive-text">Column 6</span>
                                                </span>
                                                Column 6
                                            </th>
                                            <th >
                                                <span class="slds-icon_container slds-icon-standard-opportunity slds-m-right_xx-small" title="Account">
                                                    <svg class="slds-icon slds-icon_x-small" aria-hidden="true">
                                                        <use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="/apexpages/slds/latest/assets/icons/standard-sprite/svg/symbols.svg#client"></use>
                                                    </svg>
                                                    <span class="slds-assistive-text">Column 7</span>
                                                </span>
                                                Column 7
                                            </th>
                                            <th >
                                                <span class="slds-icon_container slds-icon-standard-opportunity slds-m-right_xx-small" title="Account">
                                                    <svg class="slds-icon slds-icon_x-small" aria-hidden="true">
                                                        <use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="/apexpages/slds/latest/assets/icons/standard-sprite/svg/symbols.svg#decision"></use>
                                                    </svg>
                                                    <span class="slds-assistive-text">Column 8</span>
                                                </span>
                                                Column 8
                                            </th>
                                            <th >
                                                <span class="slds-icon_container slds-icon-standard-opportunity slds-m-right_xx-small" title="Account">
                                                    <svg class="slds-icon slds-icon_x-small" aria-hidden="true">
                                                        <use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="/apexpages/slds/latest/assets/icons/standard-sprite/svg/symbols.svg#datadotcom"></use>
                                                    </svg>
                                                    <span class="slds-assistive-text">Column 9</span>
                                                </span>
                                                Column 9
                                            </th>
                                            <th >
                                                <span class="slds-icon_container slds-icon-standard-opportunity slds-m-right_xx-small" title="Account">
                                                    <svg class="slds-icon slds-icon_x-small" aria-hidden="true">
                                                        <use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="/apexpages/slds/latest/assets/icons/standard-sprite/svg/symbols.svg#drafts"></use>
                                                    </svg>
                                                    <span class="slds-assistive-text">Column 10</span>
                                                </span>
                                                Column 10
                                            </th>
                                            <th >
                                                <span class="slds-icon_container slds-icon-standard-opportunity slds-m-right_xx-small" title="Account">
                                                    <svg class="slds-icon slds-icon_x-small" aria-hidden="true">
                                                        <use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="/apexpages/slds/latest/assets/icons/standard-sprite/svg/symbols.svg#dataset"></use>
                                                    </svg>
                                                    <span class="slds-assistive-text">Column 11</span>
                                                </span>
                                                Column 11
                                            </th>                                            
                                        </tr>
                                    </thead>
                                    <tbody>                        
                                        <tr>
                                            <td>
                                                Value 1 
                                            </td>
                                            <td>
                                                Value 2 
                                            </td>  
                                            <td>
                                                Value 3 
                                            </td>  
                                            <td>
                                                Value 4 
                                            </td>  
                                            <td>
                                                Value 5 
                                            </td>  
                                            <td>
                                                Value 6 
                                            </td>  
                                            <td>
                                                Value 7 
                                            </td>
                                            <td>
                                                Value 8 
                                            </td>       
                                            <td>
                                                Value 9 
                                            </td>       
                                            <td>
                                                Value 10 
                                            </td>       
                                            <td>
                                                Value 11 
                                            </td>                                                         
                                        </tr>
                                        <tr>
                                            <td>
                                                Value 1 
                                            </td>
                                            <td>
                                                Value 2 
                                            </td>  
                                            <td>
                                                Value 3 
                                            </td>  
                                            <td>
                                                Value 4 
                                            </td>  
                                            <td>
                                                Value 5 
                                            </td>  
                                            <td>
                                                Value 6 
                                            </td>  
                                            <td>
                                                Value 7 
                                            </td>
                                            <td>
                                                Value 8 
                                            </td>       
                                            <td>
                                                Value 9 
                                            </td>       
                                            <td>
                                                Value 10 
                                            </td>       
                                            <td>
                                                Value 11 
                                            </td>                                                         
                                        </tr>
                                    </tbody>                                 
                                </table>                        
                            </apex:outputPanel>                         
                        </div>                  
                    </div>
                </div>
                
                <script type="text/javascript" charset="utf8" src="https://code.jquery.com/jquery-3.3.1.js"></script> 
                <script type="text/javascript" charset="utf8" src="https://cdn.datatables.net/1.10.19/js/jquery.dataTables.min.js"></script> 
                <script type="text/javascript" charset="utf8" src="https://cdn.datatables.net/fixedheader/3.1.5/js/dataTables.fixedHeader.min.js"></script> 
                <script type="text/javascript" charset="utf8" src="https://cdn.datatables.net/buttons/1.5.6/js/dataTables.buttons.min.js"></script> 
                <script type="text/javascript" charset="utf8" src="https://cdn.datatables.net/buttons/1.5.6/js/buttons.colVis.min.js"></script>
                <script type="text/javascript" charset="utf8" src="https://cdn.datatables.net/colreorder/1.5.1/js/dataTables.colReorder.min.js"></script>
                
                <script>
                $("#fourthTab").on("click",function(){
                    $("#tab-default-5").addClass("slds-hide");
                    $("#fifthTab").removeClass("slds-is-active");
                    $("#fourthTab").addClass("slds-is-active");
                    $("#tab-default-4").addClass("slds-show");
                    $("#tab-default-4").removeClass("slds-hide");
                });
                $(document).ready(function() {
                    var table = $('#data').DataTable( {
                        "lengthMenu": [[10, 25, 50, -1], [10, 25, 50, "All"]],
                        "order": [],
                        stateSave: true,
                        responsive: true,
                        colReorder: true,
                        "scrollX": false,
                        dom: 'lBfrtip',
                        "columnDefs": [
                            {
                                "targets": "hide-default",
                                "visible": false,
                                "searchable": false,
                                "orderable": false
                            },
                            {
                                "targets": [ 10 ],
                                "visible": false,
                                "searchable": false,
                                "orderable": false
                            }
                            
                        ],
                        buttons: [
                            'colvis',
                            {
                                text: 'Reset',
                                className: 'reset-button',
                                action: function ( e, dt, node, config ) {
                                    localStorage.clear();
                                    location.reload();
                                }
                            }
                            
                        ],
                        language: {
                            searchPlaceholder: "Search records"
                        }
                    } );
                    $(".buttons-colvis").empty();
                    $(".buttons-colvis").append(
                        "\n <span class='slds-icon_container slds-icon-utility-settings' title='Description of icon when needed'>\n                              <svg class='slds-icon slds-icon-text-default slds-icon_small' aria-hidden='true'>\n                                <use xmlns:xlink='http://www.w3.org/1999/xlink' xlink:href='/apexpages/slds/latest/assets/icons/utility-sprite/svg/symbols.svg#settings'></use>\n                              </svg>\n                              <span class='slds-assistive-text'>Column Visibility</span>\n                            </span>\n                         "
                    );
                } );
                </script>
            </apex:form>
        </body>        
    </html>
</apex:page>

Popular Posts

Salesforce LWC Code for Multi-Select Lookup

Introduction: In Salesforce Lightning Web Components (LWC), implementing a multi-select lookup field can enhance the user experience and provide greater flexibility for selecting multiple related records. In this blog post, we will walk through the process of creating a multi-select lookup field using LWC. We will cover the required code snippets and provide step-by-step instructions to help you implement this functionality in your Salesforce org.

How to Save Quote PDF, Send PDF, Preview PDF in salesforce with custom functionality

Want to develop custom pdf viewer, save pdf in quote pdf related List and Send quote to customer on button click when quote is custom in salesforce . These functionality are standard from salesforce. but you can develop these functionality custom in salesforce. Here is the solution:- Custom button to save Quote PDF and send PDF  Step 1:-  First Create Two custom button. which will used for PDF preview and Save quote pdf in quotes pdf related list.                               1. PDF preview Button                              2. Save & Send Quote Button Replace "Your VF page here" to Your quote PDF cuatom page. Step 2:-  PDF preview button   pdf preview button will display the pdf's preview in standard format of salesforce. So you need to set the  following configuration (In picture). After that you have ...

LWC Code Sample for Global List View Component

Introduction: In this blog post, we will explore how to create a Global List View component using Lightning Web Components (LWC). List views are a powerful feature in Salesforce that allow users to filter and display records based on specific criteria. By creating a custom Global List View component, we can extend this functionality and provide a more tailored experience for our users. We will walk through the steps of creating the component and provide a sample code that you can use as a starting point for your own implementation.

Insert formatted data (HTML) in Rich Text Area

Here I am going to show you, How  to insert formatted data (table, colorful text etc) in rich text area field salesforce. We can directly use updated rich text area in our email templates without doing any extra code for email template. Here is sample code. //Heading for rich text area content. string body='<h3 style=\"color: #2e6c80;\">your heading :</h3>\n              <ol style=\"list-style: none; font-size: 12px; line-height: 32px; \">\n'; body += '<li style=\"clear: both;\"><b>'+Your Label Name+'  : </b> '+                     yourValue.replaceAll(';',' , ') +'</li>';  body +='</ol>'; yourRichTextAreaField=body; Below code is for table:-

Download JSON File in LWC: Code Examples

Introduction: In Lightning Web Components (LWC), there are times when you may need to download JSON files from your Salesforce application. Whether you're working on a data export feature or need to provide a JSON file for external integrations, being able to generate and download JSON files is a valuable skill. In this blog post, we will explore some code examples that demonstrate how to download JSON files in LWC.  Let's get started!

Full, to Reset Lightning Input Fields in LWC

Introduction: In this blog post, we will explore how to create a full dynamic solution to reset Lightning input fields in Lightning Web Components (LWC). The ability to reset input fields is a common requirement in web applications, and having a reusable and efficient approach can greatly enhance user experience. We will be leveraging the power of LWC and JavaScript to achieve this functionality. So let's get started!

Uninstall all Windows 10 default apps using Powershell

Here is script to uninstall all windows 10 default modern apps. This script uninstalls xbox, xbox Game bar, Xbox App,Xbox Gaming Overlay, Get started etc from your computer. No need to run one by one commands Just copy below script, run  powershell as administrator and paste script and press enter . It will automatically uninstall all default programs.  If you do not  want to uninstall some apps than just remove " "  line from script. $packages = @( "7EE7776C.LinkedInforWindows" "C27EB4BA.DropboxOEM" "Microsoft.3DBuilder" "Microsoft.Microsoft3DViewer"