How to extend the Action Button to add custom action ?

Hello,

We are wondering if someone knows of to extend the core action button to define a custom action ; for instance, how to call a custom code, eventually with some parameters.

Many thanks for your help,

Fred

Parents Reply Children
  • Depending on what you want to do with the custom action, you could perhaps use a custom Sugar Formula to do the dirty work OR go with Enrico's suggestion of creating a completely custom button that's not tied to the ActionButton stuff.
    I'd avoid extending it as it seems like asking for trouble down the line.

  • Hi  ,

    I agree with  .

    Honestly, I don't think action buttons have been built with custom extensibility in mind, hence why my suggestions. But I am more than happy to be proven wrong if you want to attempt this! You are better off asking for a feature request to Sugar.

    For example, some of the components that come to mind are:

    • the studio interface to be able to add buttons
    • the logic that adds the button to the right place, which needs to be aware of your changes
    • the logic that triggers when you press the button
    • the API that triggers

    All the above are a mix of layouts, views and plugins, which in themselves are not easy to extend. You could override them, and then lose any future upgrades coming from Sugar on this functionality.

    Feel free to have a look at all the files with a quick code grep:

    grep -Ri "actionbutton" . | grep  -v "min" | grep -v "Minified" | grep -v "lang.php" | grep -v ".md5" | grep -v "autoload_" | grep -v "cache"

    and you will see what I mean...

    I believe this approach would just be looking for troubles.

    Good luck!

    --

    Enrico Simonetti

    Sugar veteran (from 2007)

    www.naonis.tech


    Feel free to reach out for consulting regarding:

    • API Integration and Automation Services
    • Sugar Architecture
    • Sugar Performance Optimisation
    • Sugar Consulting, Best Practices and Technical Training
    • AWS and Sugar Technical Help
    • CTO-as-a-service
    • Solutions-as-a-service
    • and more!

    All active SugarCRM certifications

    Actively working remotely with customers based in APAC and in the United States