Results 1 to 2 of 2

Thread: Adding a File to an existing module

  1. #1
    naveenshurpalekar is offline Senior Member
    Join Date
    Aug 2009
    Posts
    33

    Default Adding a File to an existing module

    hey Folks,
    am new to Sugar and right now trying to understand how it works . What i am planning to do right now is to Add a Confirmation Alert box when i click on the Save Button in the Accounts module. Could anybody guide me with a Step By Step procedure i.e. what changes have to be made in what files, etc or provide me with a link where this is explained.
    i appreciate the help from u guys.
    thank u

  2. #2
    dlorenzetti's Avatar
    dlorenzetti is offline Sugar Community Member
    Join Date
    Jan 2008
    Location
    São Paulo, Brasil
    Posts
    189

    Default Re: Adding a File to an existing module

    Hello,

    Edit the file custom/modules/Accounts/metadata/editviewdefs.php or if this file don't exists copy modules/Accounts/metadata/editviewdefs.php to this folder and then edit to that:

    PHP Code:
        'templateMeta' => 
        array (
          
    'form' => 
          array (
            
    'buttons' => 
            array (
              
    => 
              array (
            
    'customCode' => '<input type="submit" value="{$APP.LBL_SAVE_BUTTON_LABEL}" name="button" onclick="this.form.action.value=\'Save\'; 
            return my_verification();" class="button" accesskey="{$APP.LBL_SAVE_BUTTON_KEY}" title="{$APP.LBL_SAVE_BUTTON_TITLE}"/>'
    ,
          ),
              
    => 'CANCEL',
            ),
          ),
          
    'maxColumns' => '2',
          
    'widths' => 
          array (
            
    => 
            array (
              
    'label' => '10',
              
    'field' => '30',
            ),
            
    => 
            array (
              
    'label' => '10',
              
    'field' => '30',
            ),
          ),
          
    'includes' => 
          array (
            
    => 
            array (
              
    'file' => 'modules/Accounts/Account.js',
            ),
            
    => 
            array (
              
    'file' => 'custom/modules/Accounts/MyVerification.js',
            ),
          ),
        ), 
    See that in the onclick of the save button I call the function my_verification(); and in the includes I include MyVerification.js, so you need to do this file with this function:

    MyVerification.js
    PHP Code:
    function check_phones(){

           
    //Put your confirmation here
        
        
    return check_form('EditView');

    You can use the function and the file with the name you want but don't remove the "return check_form('EditView');" part because this part will make the validation of fields (required fields, int fields, etc.).


    I hope it helps,
    Diego Lorenzetti
    Lampada Global Services - Open Source Solutions
    Phone: +55 11 3237-3110
    Email: equipe@lampadaglobal.com
    Site: www.lampadaglobal.com

    Lampada Global delivers offshore software development and support services to customers around the world.
    Lampada is proud to be a SugarCRM Gold Partner, revolutionizing Customer Relationship Management.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Adding new links inside existing module
    By aswath28 in forum Developer Help
    Replies: 2
    Last Post: 2008-10-18, 04:47 AM
  2. Replies: 0
    Last Post: 2007-12-27, 07:56 AM
  3. Adding Existing subpanel
    By itlime in forum Help
    Replies: 2
    Last Post: 2007-09-25, 02:49 PM
  4. Adding Logic Hook to existing
    By Superman in forum Developer Help
    Replies: 2
    Last Post: 2006-12-18, 09:38 PM
  5. Replies: 3
    Last Post: 2005-10-21, 05:28 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •