How can I add custom button next to Save, Cancel on Account module and custom module?

Hi Team,

Can some one suggest us the way to add custom button next to SAVE, CANCEL Any module and custom Module.

Also please suggest how can we write some custom on the click of the button.

Regards,

Deepak

Parents
  • Hi Parag Mittal

    This post may help you.

    Let me know if you need more help.

    Best Regards

    S Ramana Raju

  • Hi Ramana

    I am having problems getting the button to recognize the onclick function billToButtonFunt(). The error message is as follows:

    Uncaught ReferenceError: myButtonFunt is not defined. I am sending you my code, it seems that the .js file is not being recognized, however I did try clicking on the link to the js file on viewcode section and I can see the function clearly.

    <?php
    $viewdefs ['Leads'] =
    array (
    'EditView' =>
    array (
    'templateMeta' =>
    array (
    'form' =>
    array (
    'hidden' =>
    array (
    0 => '<input type="hidden" name="prospect_id" value="{if isset($smarty.request.prospect_id)}{$smarty.request.prospect_id}{else}{$bean->prospect_id}{/if}">',
    1 => '<input type="hidden" name="account_id" value="{if isset($smarty.request.account_id)}{$smarty.request.account_id}{else}{$bean->account_id}{/if}">',
    2 => '<input type="hidden" name="contact_id" value="{if isset($smarty.request.contact_id)}{$smarty.request.contact_id}{else}{$bean->contact_id}{/if}">',
    3 => '<input type="hidden" name="opportunity_id" value="{if isset($smarty.request.opportunity_id)}{$smarty.request.opportunity_id}{else}{$bean->opportunity_id}{/if}">',
    4 => '<script type="text/javascript" src="https://code.jquery.com/jquery-latest.min.js"></script>',
    5 => '<script type="text/javascript" src="./custom/include/javascript/test.js"></script>',

    ),

    'buttons' =>
    array (
    0 => 'SAVE',
    1 => 'CANCEL',
    // Add This code
    2 =>
    array (

    'customCode' => '<input id="MyButton" title="My Button" class="button" type="button" name="MyButton" value="My Button" onclick="myButtonFunt();">',


    ),
    ),
    ),

Reply
  • Hi Ramana

    I am having problems getting the button to recognize the onclick function billToButtonFunt(). The error message is as follows:

    Uncaught ReferenceError: myButtonFunt is not defined. I am sending you my code, it seems that the .js file is not being recognized, however I did try clicking on the link to the js file on viewcode section and I can see the function clearly.

    <?php
    $viewdefs ['Leads'] =
    array (
    'EditView' =>
    array (
    'templateMeta' =>
    array (
    'form' =>
    array (
    'hidden' =>
    array (
    0 => '<input type="hidden" name="prospect_id" value="{if isset($smarty.request.prospect_id)}{$smarty.request.prospect_id}{else}{$bean->prospect_id}{/if}">',
    1 => '<input type="hidden" name="account_id" value="{if isset($smarty.request.account_id)}{$smarty.request.account_id}{else}{$bean->account_id}{/if}">',
    2 => '<input type="hidden" name="contact_id" value="{if isset($smarty.request.contact_id)}{$smarty.request.contact_id}{else}{$bean->contact_id}{/if}">',
    3 => '<input type="hidden" name="opportunity_id" value="{if isset($smarty.request.opportunity_id)}{$smarty.request.opportunity_id}{else}{$bean->opportunity_id}{/if}">',
    4 => '<script type="text/javascript" src="https://code.jquery.com/jquery-latest.min.js"></script>',
    5 => '<script type="text/javascript" src="./custom/include/javascript/test.js"></script>',

    ),

    'buttons' =>
    array (
    0 => 'SAVE',
    1 => 'CANCEL',
    // Add This code
    2 =>
    array (

    'customCode' => '<input id="MyButton" title="My Button" class="button" type="button" name="MyButton" value="My Button" onclick="myButtonFunt();">',


    ),
    ),
    ),

Children
No Data