AnsweredAssumed Answered

Create several buttons for a form

Question asked by Thomas Thomas on Jun 3, 2015
Latest reply on Jun 9, 2015 by Rolustech Rolustech
Hi there,

I am a PHP developer but very new with SugarCRM.

I am working on a already existing custom module, where there is dropdown button that displays several options : Edit, Delete, etc and 2 of these options (Create a task and Create a document) I would like to have them on 2 buttons separately next to this main button, like shortcuts.
I have tried to do many changes on the form array but I cannot find a way to do that:
array (
  'templateMeta' =>
  array (
    'form' =>
    array (
      'buttons' =>
          array (
        0 => 'EDIT',
        1 => 'DUPLICATE',
        2 => 'DELETE',
        3 => 'FIND_DUPLICATES',
        'Create a task' =>
        array (
          'customCode' => '<input type="button" class="button" onClick="$jq(\'#formformTasks\').submit();document.location.href=\'#formformTasks\'" value="Go to task">',
        ),
        'Create a document' =>
        array (
          'customCode' => '<input type="button" class="button" onClick="$jq(\'#formformdocuments_accounts\').submit();document.location.href=\'#formformdocuments_accounts\'" value="Go to document">',
        ),
      ),
    ),
    'maxColumns' => '2',...

Outcomes