SuiteCRM8.x custom buttons under Action dropdown not visible

Hello Friends,

After upgrading SuiteCRM from version 7.x to 8.x, the action buttons are no longer visible. In SuiteCRM 7.x, the action buttons were visible and functioning as expected, but in the latest version, they are not. Below is my code to add action buttons in the detail view:

php

Copy code

custom/modules/nhrem_nhr_employee/metadata/detailviewdefs.php

'form' => 
    array (
        'buttons' => 
        array (
            0 => 'EDIT',
            3 => 
            array (
                'customCode' => '<input title="Release Letter" accessKey="E" class="button primary" onclick="releaseLetter()" type="button" name="button" value="Release Letter" id="release">',
            ),
            5 => 
            array (
                'customCode' => '<input title="Appointment Letter" accessKey="E" class="button primary" onclick="appointment()" type="button" name="button" value="Appointment Letter" id="appointment">',
            ),
        ),
    ),

I need assistance as soon as possible to make the custom buttons visible again.

Example:

detail view

The v8 frontend is completely different, you need to redo your code entirely.

Hi Team,

Thanks for the response.
Actually, I need the solution for the Custom Buttons which are available under the Action Dropdown near to Edit Button from Detail View in detailviewdefs.php.

I found the solution. In the latest version of SuiteCRM, custom code and JavaScript are not working. However, SuiteCRM provides a setting to achieve this. You can update the file located at:

/var/www/html/ProjectName/config/services/module/module_routing.yaml

Set index, list, and record to false to resolve the issue.

For custom modules, we can update/create the file in given location if not exist.
/var/www/html/ProjectName/extensions/defaultExt/config/module_routing.php

< ?php
use Symfony\Component\DependencyInjection\Container;

if (!isset($container)) {
    return;
}

/** @var Container $container */
$routes= $container->getParameter('legacy.module_routing') ?? [];

$routes['custom_module'] = [
    'index' => false,
    'list' => false,
    'record' => false
];

$container->setParameter('legacy.module_routing', $routes);

This is a working solution in my project.