Adding New Button

Hi,
In my module i want to add save , submit and cancel buttons. How to add new button in modules.

Thanks .

1 Like

The buttons can be defined in the viewdefs.php files which is found in modules/<module_name>/metadata. A good example of this is in modules/Accounts/metadata/detailviewdefs.php. Look for the “buttons” array.

Hello.

I use PHP 7 on SuiteCRM 7.9.4

I can not change the buttons on TASK anymore.
The detailviewdefs contains my own buttons, I Quick Repair, but the buttons are still the default buttons for TASK …

Any idea ?

Check for the Path if you are modifying the correct file.

custom/modules/Tasks/metadata/detailviewdefs.php

If this file does not exists, copy the core file from modules/Tasks/metadata/detailviewdefs.php and place it at the above path and modify it.

Hi all,
there is a little problem (or bug) in suitecrm version 794. I hope it’s only a problem in my test installation…

Everytime you “quick and repair”, in the custom metadata files like custom/modules/Tasks/metadata/detailviewdefs.php, suitecrm write first your customization, and at the end of the file override the “templateMeta” content of the $viewdefs array.

So, become impossible to customize “templateMeta” content of the array and also the button list.

1 Like

So you mean there is no way to customize the buttons in an upgrade-safe way anymore ?

I don’t know how… but there is always some trick :wink:
(javascript can be one solution to add the button but not so elegant)

I think is a bug … is too strange and seems to have no sense this kind of rewrite of the variable

Is there a way to do this WITHOUT using/customising the detailviewdefs.php file? I’m creating an installable module with custom buttons/actions and if I do it this way my detailviewdefs.php file MAY overwrite any pre-existing customisations, not a nice thing to do :=]

Thanks for any assistance in advance

Hi, In my module i want to add separate Button Log Call and Compose email Button under activity panel in Cases module . How to add button in modules.

One Button for Log call and one for Compose email
can u please help me …

Anyone looking for solutions to this problem, see this article:

https://www.sugaroutfitters.com/blog/how-to-add-buttons-to-views-in-sugarcrm

Any solution for this issue? I am also facing this problem.

@saqib
Please, give me some more information. What version of SuiteCRM do you use? Where do you add button?