Salesforce Workbench SOQL Query Maximiser

Increases the space available to perform queries with when the screen is wider than 1000px

Tính đến 09-04-2024. Xem phiên bản mới nhất.

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

Bạn sẽ cần cài đặt một tiện ích mở rộng như Tampermonkey hoặc Violentmonkey để cài đặt kịch bản này.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(Tôi đã có Trình quản lý tập lệnh người dùng, hãy cài đặt nó!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name         Salesforce Workbench SOQL Query Maximiser
// @namespace    http://tampermonkey.net/
// @version      2024-04-08
// @description  Increases the space available to perform queries with when the screen is wider than 1000px
// @author       Wilsoff
// @match        https://workbench.developerforce.com/query.php
// @icon         https://www.google.com/s2/favicons?sz=64&domain=developerforce.com
// @grant        none
// @license MIT
// ==/UserScript==

(function() {
    
    'use strict';

    if (window.innerWidth >= 1000) {

        //Make whole page 100% width
        var main = document.getElementById('mainBlock');
        main.style.setProperty('width', '100%', 'important');

        //Make the field selector bigger
        var elem = document.getElementsByName('QB_field_sel[]');
        elem[0].size = 30;
        elem[0].style.width = '32em';

        //Make the elements on the right align to the left
        var options1 = document.querySelector("#query_form > table > tbody > tr:nth-child(1) > td:nth-child(2) > table:nth-child(1) > tbody > tr");
        options1.style.setProperty('display', 'flex', 'important');

        var options2 = document.getElementById('QB_right_sub_table');
        options2.style.setProperty('display', 'flex', 'important');

        //Add spacing to make it look more like the original:
        var tableDatas = document.getElementsByTagName('td');
        var i = 0;

        for(i=0;i<tableDatas.length;i++){
            if(tableDatas[i].innerHTML.startsWith("Deleted and archived records")) {
                tableDatas[i].style.setProperty('margin-left', '50px', 'important');
                break;
            }
        }

        for(i=0;i<tableDatas.length;i++){
            if(tableDatas[i].innerHTML.startsWith("<br>Max Records")) {
                tableDatas[i].style.setProperty('padding-left', '50px', 'important');
                break;
            }
        }

        document.getElementById('QB_limit_txt').style.setProperty('margin-left', '50px', 'important');

    }

})();