Buttons not showing in Accounts DetailView when primary email is added

Hello,

I'm new in this and I have some strange issue which I can't reproduced why is happening. I have added LogicHook on after_retrieve to make some logic 

$hook_array['after_retrieve'][] = Array(
3,
'UpdateInfi',
'custom/Extension/modules/Accounts/Ext/LogicHooksData/HelperHooks.php',
'HelperHooks',
'setInfo'
);


and this method is adding new button html code, and everything is working fine except I add the primary email to the current account and this button after it is not showing after updating the account. I don't have any idea why is this happening.

public function setInfo(&$bean, $event, $arguments) {
$bean->erp_info = html_entity_decode($bean->erp_info);
$bean->custom_fields->retrieve();
$button = '<div>
       <input type="button" name="submit" value="Request something"/>';                                     
</div>';


$bean->erp_info = $bean->erp_info.$button;

}

Parents
  • Hey  ,

    I assume your end goal is for users to be able to call an external system (ERP) when a button is clicked.

    If that's the aim, I would approach the customisation in different ways for three main reasons:

    1. Logic hooks are to manipulate data - which you do not really need to do
    2. Retrieval-based logic hooks can hinder performance - especially as you re-retrieve custom fields
    3. The customisation feels more front-end based than back-end based 

    As alternative approaches, I would first attempt using Action Buttons which might not need any coding, if they let you do exactly what you want to do.

    If Action Buttons cannot achieve what you would like to achieve, I would suggest that you extend the front-end views for creation and editing, depending on when/where you need the customisation.

     

    While I completely understand that getting started with Sugar development might be overwhelming at first, due to information overload and not knowing what is right or not so right, there are great resources to get familiarity with the building blocks of the platform.

    For example , and  put together an onboarding framework that should help you get started. Then there are the developer guide, and certifications which will help you confirm you are on the right path.

    All the best with your journey!

    --

    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
  • Hey  ,

    I assume your end goal is for users to be able to call an external system (ERP) when a button is clicked.

    If that's the aim, I would approach the customisation in different ways for three main reasons:

    1. Logic hooks are to manipulate data - which you do not really need to do
    2. Retrieval-based logic hooks can hinder performance - especially as you re-retrieve custom fields
    3. The customisation feels more front-end based than back-end based 

    As alternative approaches, I would first attempt using Action Buttons which might not need any coding, if they let you do exactly what you want to do.

    If Action Buttons cannot achieve what you would like to achieve, I would suggest that you extend the front-end views for creation and editing, depending on when/where you need the customisation.

     

    While I completely understand that getting started with Sugar development might be overwhelming at first, due to information overload and not knowing what is right or not so right, there are great resources to get familiarity with the building blocks of the platform.

    For example , and  put together an onboarding framework that should help you get started. Then there are the developer guide, and certifications which will help you confirm you are on the right path.

    All the best with your journey!

    --

    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
No Data