Open meeting after call save

Hi,
I am developing a feature to insert a new button in the ‘edit view’ of the module Calls.
I created the file /custom/modules/Calls/metadata/editviewdefs.php and added the button in:

$viewdefs [‘Calls’][‘EditView’][‘templateMeta’][‘form’][‘buttons’]

4 =>
            array(
              'customCode' => '<input title="{$MOD.LBL_OPEN_MEETING_BUTTON_TITLE}"
                                id="SAVE_AND_OPEN_MEETING"
                                class="button"
                                onclick="console.log(SUGAR);
                                          SUGAR.calls.fill_invitees();
                                          document.EditView.action.value=\'Save\';
                                          document.EditView.return_action.value=\'EditView\';
                                          formSubmitCheck();"
                                type="button"
                                name="button"
                                value="{$MOD.LBL_OPEN_MEETING_BUTTON_TITLE}">'
            )

Unfortunately the documentation regarding metadata is not very detailed… (It would be useful to have documentation on the Javascript object ‘SUGAR’)
The new button can be seen but I don’t know how to add the save and open function of a new record ‘Meeting’ always in ‘edit view’…
Any solutions?

Thanks in advance

Check here for some ideas:

https://stackoverflow.com/questions/15254673/sugarcrm-how-to-get-popup-when-click-on-save-button

Hi AlxGr,
thanks for the link.
I have seen that the proposed solution is similar to using the hooks.
I don’t want to use hooks because I have a button dedicated to the specific function of ‘saving’ and ‘redirecting’ to ‘schedule meeting’.
Basically it would be enough for me to do in Javascript what you can do in php through :


$queryParams = array(
    'module' => 'Meetings',
    'action' => 'EditView',
   );
   SugarApplication::redirect('index.php?' . http_build_query($queryParams));

Is there a similar method for the ‘SUGAR’ Javascript object?

Thanks!!!

It might be a s.tupi.d idea but what if you try this:


4 =>
            array(
              'customCode' => '<input title="{$MOD.LBL_OPEN_MEETING_BUTTON_TITLE}"
                                id="SAVE_AND_OPEN_MEETING"
                                class="button"
                                onclick="console.log(SUGAR);
                                          SUGAR.calls.fill_invitees();
                                          document.EditView.action.value=\'Save\';
                                          document.EditView.return_action.value=\'EditView\';
                                          formSubmitCheck();
SUGAR.ajaxUI.loadContent(\'index.php?module=Meetings&amp;action=EditView&amp\');"
                                type="button"
                                name="button"
                                value="{$MOD.LBL_OPEN_MEETING_BUTTON_TITLE}">'
            )

Thanks to AlxGr,
this is exactly what I was looking for!
It works perfectly B-) .

Thank you very much!

Glad it worked!