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
  • Question: Given that you are looking to customise anyway, why don't you add a completely custom button then? It could call your API or do whatever you need to.

    It might be easier than attempting to try to extend Action Button, which I feel might become brittle with upgrades as well.

    --

    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

  • Hi  ,

    we know how to create custom button with custom code.

    But with the new and very cool actionbutton feature, it would be great to define button the same way, with a setting screen but also benefit the actionbutton settings (embed the button in the header or the record layout, the list layout, the focus drawer layout etc.).

    So without re-code everything, I was looking for a way to extend core actionButton to define my new action.

    Fred

  • 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

Reply
  • 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

Children