You reached the limit for dashboard run as the logged-in user

123    Asked by floria_1918 in Salesforce , Asked on May 20, 2024

 I am currently working on a data analysis project and I have been running multiple complex queries on my dashboard. Suddenly I received q notification which was stating “You have reached the limit for dashboard runs as the logged-in user”. How can I troubleshoot and resolve this particular issue? 

Answered by Alastair McDade

 In the context of Salesforce, here are the appropriate approach given:-

Optimization of queries

You should try to review and optimize the queries to reduce the number of dashboard runs required.

Caching mechanism

Try to implement a caching mechanism for the out of storing frequently accessed data temporarily.

Batch processing

If feasible, try to consider batch processing for large datasets instead of running the queries in real-time.

Schedule Refresh

You can schedule the dashboard refresh during off-peak hours or less frequently accessed times to avoid hitting the limit during high usage periods.

Review dashboard usage

You can analyze the dashboard usage patterns to identify any inefficient or resource-intensive Component.

Here is an example given in Python:-

Import pandas as pd
From sqlalchemy import create_engine
# Assume you have a database connection
Engine = create_engine(‘sqlite:///:memory:’)
# Example query that needs optimization
Query = “””
SELECT column1, column2, SUM(column3) as total
FROM table
WHERE date >= ‘2024-01-01’ AND date <= ‘2024-04-30’
GROUP BY column1, column2
“””
# Fetch data using the optimized query
Optimized_query = “””
SELECT column1, column2, SUM(column3) as total
FROM table
WHERE date >= ‘2024-01-01’ AND date <= ‘2024-04-30’
AND column1 IN (‘value1’, ‘value2’, ‘value3’) -- Filter to specific values
GROUP BY column1, column2
“””
# Execute the optimized query
Df = pd.read_sql_query(optimized_query, engine)
# Further processing or visualization with the data
Print(df.head())
Here is the example given in java programming language:-
Import java.sql.Connection;
Import java.sql.DriverManager;
Import java.sql.PreparedStatement;
Import java.sql.ResultSet;
Import java.sql.SQLException;
Public class DashboardOptimization {
    Public static void main(String[] args) {
        Connection connection = null;
        PreparedStatement preparedStatement = null;
        ResultSet resultSet = null;
        Try {
            // Establish a connection to your database
            Connection = DriverManager.getConnection(“jdbc:mysql://localhost:3306/mydatabase”, “username”, “password”);
            // Example query that needs optimization
            String query = “SELECT column1, column2, SUM(column3) as total “ +
                           “FROM table “ +
                           “WHERE date >= ‘2024-01-01’ AND date <= ‘2024-04-30’ “ +
                           “GROUP BY column1, column2”;
            // Prepare the optimized query
            String optimizedQuery = “SELECT column1, column2, SUM(column3) as total “ +
                                    “FROM table “ +
                                    “WHERE date >= ‘2024-01-01’ AND date <= ‘2024-04-30’ “ +
                                    “AND column1 IN (‘value1’, ‘value2’, ‘value3’) “ + // Filter to specific values
                                    “GROUP BY column1, column2”;
            // Execute the optimized query
            preparedStatement = connection.prepareStatement(optimizedQuery);
            resultSet = preparedStatement.executeQuery();
            // Process the result set
            While (resultSet.next()) {
                String column1 = resultSet.getString(“column1”);
                String column2 = resultSet.getString(“column2”);
                Double total = resultSet.getDouble(“total”);
                // Process the data or send it to the frontend for visualization
                System.out.println(“Column1: “ + column1 + “, Column2: “ + column2 + “, Total: “ + total);
            }
        } catch (SQLException e) {
            e.printStackTrace();
        } finally {
            // Close the resources
            Try {
                If (resultSet != null) resultSet.close();
                If (preparedStatement != null) preparedStatement.close();
                If (connection != null) connection.close();
            } catch (SQLException e) {
                e.printStackTrace();
            }
        }
    }
}

Here is the example of HTML:-




    <meta</span> charset=”UTF-8”>

    <meta</span> name=”viewport” content=”width=device-width, initial-scale=1.0”>

    Dashboard Optimization

    [removed]

        // Assume you have a JavaScript function to fetch and display data
        Function fetchData() {
            // Make an AJAX request to fetch data from the server
            Const xhr = new XMLHttpRequest();
            Xhr.open(‘GET’, ‘fetch_data.php?startDate=2024-01-01&endDate=2024-04-30’, true);
            Xhr.onreadystatechange = function() {
                If (xhr.readyState === 4 && xhr.status === 200) {
                    Const data = JSON.parse(xhr.responseText);
                    processData(data);
                }
            };
            Xhr.send();
        }
        // Process the fetched data
        Function processData(data) {
            // Example processing and visualization code
            Const container = document.getElementById(‘dataContainer’);
            Container[removed] = ‘’; // Clear previous data
            Data.forEach(item => {
                Const div = document.createElement(‘div’);
                div.textContent = `Column1: ${item.column1}, Column2: ${item.column2}, Total: ${item.total}`;
                container.appendChild(div);
            });
        }
        // Call the fetchData function on page load
        [removed] = function() {
            fetchData();
        };

    [removed]



    Dashboard Optimization

   





Your Answer

Interviews

Parent Categories