Create new action (left side)

Hey,

I want to create a new action, on the left side of the web, where it says Actions: Create new user, view new user, etc…

How can I do that?

Thanks

Hello there,

If you want to add it to specific module, You can add as new menu item using extension directory.

Create file
here
custom/Extension/modules//Ext/Menus/anyname.php

You may find more about it here.

1 Like

Hey thanks for the answer, but I don’t have the directory /Menus. Should I create it?

Yes, You should create it, Make sure about case sensitive name of the folder and file.

Another question :>, if the action of that menu option, is a custom action, in the file.php, when it says this:

$module_menu[] =Array(“index.php?module=Reports&action=index&view=contacts”,

Should I write, “index.php=module=MYMODULE&action=MYNEWFILE”, ?

Correct, if it is custom action.

Here is the guide for detail explanation

Thanks, also, could you help with this topic?

https://suitecrm.com/forum/suitecrm-7-0-discussion/12034-adding-massive-print-option-in-custom-module

This is what i’m trying to do with this new action.

This is what I just did:
1- I created the directory Menus in custom/Extension/modules/MYMODULE/Ext/Menus/menu.ext.php with this:


<?php
    $module_menu[] = Array(
        //URL
        "index.php?module=MYMODULE&action=test", (this test is a php file in /modules/MYMODULE/, this file does what I want to accomplish) 
        
        //Label String
        $mod_strings['LNK_TEST'], 
        
        //Image icon. Icons are found in ./themes/default/images. 
        '_blank.png', 
        
        //Module Name
        'MYMODULE' 
    );

2- I created in ./custom/Extension/application/Ext/Language/es-ES.MYMODULE.php:


<?php

    $mod_strings['LNK_TEST'] = 'This is a test';
?>

After all of that, my crm stop working, I checked the logs, but I didn’t found anything suspicious, I followed the instructions, maybe this instructions were made for sugarCRM?

Thanks!

Hello,

I can see the syntax error on this line


"index.php?module=MYMODULE&action=test", (this test is a php file in /modules/MYMODULE/, this file does what I want to accomplish) 

It should be

"index.php?module=MYMODULE&action=test",    // (this test is a php file in /modules/MYMODULE/, this file does what I want to accomplish) 

I dont see the syntax error :>, the comments I added the comments in this forum, they are not in the code.

Can you share file here ?

menu.ext.php:


<?php

$module_menu[] = Array(
            //URL
            "index.php?module=MYMODULE&action=MYACTION", 
        
            //Label String
            $mod_strings['LNK_MYACTIONLABEL'], 
        
            //Image icon. Icons are found in ./themes/default/images. 
            '_blank.png', 
        
            //Module Name
            'MYMODULE' 

?>

File seems correct,
Can you checkout the apache error log ? or temporary display error on your php.ini to identify the exact fatal error that show you the blank screen.

Where can I found this log?

The location is all depend on the OS your server using and settings.
If you are not sure, your hosting provider can guide you.
This may help you to find it your self

Another thing that might be interesting to see, if that in /custom/extension/application/Ext/language/languagefile.php

All the other files contains the array, with that type:


$app_list_strings['moduleList']['DEFAULT MODULE'] = 'MODULE LABEL';

And the file I created follow this type:


<?php

    $mod_strings['LNK_TEST'] = 'This is a test';
?>

No file is correct as it is for module string,
but your path is incorrect, it should follow as we are doing it for particular module.

custom/Extension/modules/MYMODULE/Ext/Language/

But i think it is not related to blank screen, but still you need to correct this also.

Ok, another thing i’ve noticed, in the menu.ext.php file, when I write the url, im saying this:
“index.php?module=MYMODULE&action=MYACTION”,

Is this correct? Or should I put this instead?:

“/index.php?module=MYMODULE&action=MYACTION”,

No, 1st one will be ok.

Maybe what is wrong is the custom action