How to create a popup panel

Hello everyone, I'm working with de Sugar 6.5 Community Version.

How to use a panel like that shows when i go to delete a record?

A panel like this:

I want launch a panel when the user press in a detailview custom button, with the next code:

$viewdefs [$module_name] =
array (
  'DetailView' =>
  array (
    'templateMeta' =>
    array (
      'form' =>
      array (
        'buttons' =>
        array (
          0 => 'EDIT',
          1 => 'DUPLICATE',
          2 => 'DELETE',
          3 => 'FIND_DUPLICATES',
          4 =>
          array (
            'customCode' => '<input title="{$APP.LBL_LANZAR_F_TITLE}" accessKey="{$APP.LBL_LANZAR_F_TITLE} "type="button" class="button" onClick="document.location=\'index.php?module=OMS2B_Facturacion&action=Lanzar&record={$fields.id.value}\'" name="lanzar" value="{$APP.LBL_LANZAR_F_TITLE}">',

Thanks a lot.

  • Hi,

    // detailviewdefs.php

    $viewdefs [$module_name] = 
    array (
      'DetailView' =>
      array (
        'templateMeta' =>
        array (
          'form' =>
          array (
            'buttons' =>
            array (
              0 => 'EDIT',
              1 => 'DUPLICATE',
              2 => 'DELETE',
              3 => 'FIND_DUPLICATES',
              4 =>
              array (
                'customCode' => '<input title="{$APP.LBL_LANZAR_F_TITLE}" accessKey="{$APP.LBL_LANZAR_F_TITLE} " type="button" class="button" onClick="customConfirm(\'{$fields.id.value}\');" name="lanzar" value="{$APP.LBL_LANZAR_F_TITLE}">',
              )
            ),
            'maxColumns' => '2',
            'widths' => array(
                0 => array(
                    'label' => '10',
                    'field' => '30',
                ),
                1 => array(
                    'label' => '10',
                    'field' => '30',
                ),
            ),
            'includes' => array(
                0 => array(
                    'file' => 'custom/modules/<module_name>/custom.js',
                ),
            ),

    //custom/modules/<module_name>/custom.js

    function customConfirm(record) {
        var r = confirm("Some messages!");
        if (r == true) {
            document.location = 'index.php?module=OMS2B_Facturacion&action=Lanzar&record=' + record;
        } else {
            return false;
        }
    }