Custom button not appearing on Lead Detail View

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • tiagofluz
    Junior Member
    • Jul 2025
    • 2

    #1

    Custom button not appearing on Lead Detail View

    Hello, EspoCRM community,

    I am trying to add a custom button to the "Lead" entity's detail view by following the official documentation, but the button is not appearing in the UI. I have already gone through all the basic troubleshooting steps and would appreciate some help in identifying what might be wrong.

    The goal is to create a "Send via WhatsApp" button.

    Configuration Details:

    I created the two required files in the custom directory, as per the documentation.

    1. Button Layout File:
    • Path: custom/Espo/Custom/Resources/layouts/Lead/detail-bottom.json
    • Content:

      JSON
      [
      {
      "name": "sendWhatsApp",
      "label": "Send via WhatsApp",
      "style": "primary",
      "action": "sendWhatsApp"
      }
      ]

    2. View File (JavaScript):
    • Path: custom/Espo/Custom/Resources/src/views/lead/record/detail.js
    • Content:

      JavaScript
      Espo.define('custom:views/lead/record/detail', 'views/record/detail', function (Dep) {

      return Dep.extend({

      bottomView: 'custom:views/lead/record/detail-bottom',

      actionSendWhatsApp: function () {
      // Action logic would go here
      alert('Button clicked!');
      }
      });
      });

    Troubleshooting Steps Already Taken:
    • Clear Cache & Rebuild: I have run "Clear Cache" and "Rebuild" from the Administration panel multiple times.
    • Browser Cache: I have performed hard refreshes of the page (Ctrl+F5 / Cmd+Shift+R).
    • Paths & Naming: I have double-checked that file paths and names are correct, including case-sensitivity.
    • Permissions: I have ensured that directory permissions are 755 and file permissions are 644, and that the web server user has read access.
    • JSON Validation: The content of the detail-bottom.json file has been validated and is syntactically correct.
    • Browser Developer Tools: I used the "Network" tab in the developer tools to investigate. The key finding is that the custom custom/.../detail.js file is not being loaded by the browser. Only the original core detail.js file is loaded.

    The Question:

    Given that the custom JavaScript file is not being loaded, what could be preventing EspoCRM from discovering or serving these custom files, even when all file configurations, permissions, and cache-clearing steps seem correct? Is there any other server-level cache or specific configuration I should be looking at?

    Any help or ideas would be greatly appreciated.
Working...