Results 1 to 6 of 6

Thread: How to customize update button in massupadate part

  1. #1
    varunshah is offline Member
    Join Date
    Feb 2009
    Posts
    10

    Thumbs down How to customize update button in massupadate part

    Hello,

    I have added some customized fileds in opportunity module.
    Now I want to customize update button in Massupdate part.
    How can i do that??
    I have seen that, from include/massupdate.php i can make changes.
    But How can i override that function in opportunity customization??

  2. #2
    andopes's Avatar
    andopes is offline A Sugar Hero | Help Forum Moderator
    Join Date
    Jul 2006
    Location
    São Paulo - Brazil
    Posts
    8,335

    Default Re: How to customize update button in massupadate part

    Unfortunately the customization is not upgrade safe.
    You need to modify the function getMassUpdateForm this way:

    PHP Code:
            if($this->sugarbean->module_dir == 'Opportunities') {
                
    $html.= 'your button customization';
            } else {
                
    $html .= "<table cellpadding='0' cellspacing='0' border='0' width='100%'><tr><td style='padding-bottom: 2px;' class='listViewButtons'><input onclick='return sListView.send_mass_update(\"selected\", \"{$app_strings['LBL_LISTVIEW_NO_SELECTED']}\")' type='submit' id='update_button' name='Update' value='{$lang_update}' class='button'>";
            } 
    Cheers
    André Lopes
    DevToolKit / Project of the Month - June 2009
    Lampada Global Services- Open Source Solutions
    Avenida Ipiranga, 318
    Bloco B - CJ 1602
    São Paulo, SP 01046-010
    Brazil
    Office: +55 11 3237-3110
    Mobile: +55 11 7636-5859
    e-mail: andre@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.

    I DO NOT answer questions through PM and Email. If you need some help post your question into SugarForum.

  3. #3
    varunshah is offline Member
    Join Date
    Feb 2009
    Posts
    10

    Default Re: How to customize update button in massupadate part

    Thank You...
    So i have to make changes in massupdate.php file.
    Means I can't override this function for my module. I have to make changes directly in the file with out overriding it.
    Right?
    Last edited by varunshah; 2009-05-19 at 03:28 PM.

  4. #4
    andopes's Avatar
    andopes is offline A Sugar Hero | Help Forum Moderator
    Join Date
    Jul 2006
    Location
    São Paulo - Brazil
    Posts
    8,335

    Default Re: How to customize update button in massupadate part

    Exactly!

    Unfortunately the Mass Update form is not customizable.

    Cheers
    André Lopes
    DevToolKit / Project of the Month - June 2009
    Lampada Global Services- Open Source Solutions
    Avenida Ipiranga, 318
    Bloco B - CJ 1602
    São Paulo, SP 01046-010
    Brazil
    Office: +55 11 3237-3110
    Mobile: +55 11 7636-5859
    e-mail: andre@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.

    I DO NOT answer questions through PM and Email. If you need some help post your question into SugarForum.

  5. #5
    varunshah is offline Member
    Join Date
    Feb 2009
    Posts
    10

    Default Re: How to customize update button in massupadate part

    Thank You....

  6. #6
    whiteFwolf is offline Member
    Join Date
    Jun 2008
    Posts
    18

    Cool Re: How to customize update button in massupadate part

    Actually there is a way to customize the update button in the mass update.

    1. Write a view.list.php view for the module you would like to customize the massupdate form.
    2. Write a JavaScript that will change the button callback function. You can add AJAX also there.
    3. echo the JS file inside the view.list.php

    Done

    Example JS:


    /***************************************
    *
    ***************************************/
    function addLoadEvent(func)
    {
    var oldonload = window.onload;
    if (typeof window.onload != "function") {
    window.onload = func;
    } else {
    window.onload = function() {
    if (oldonload) {
    oldonload();
    }
    func();
    }
    }
    }


    /***************************************
    *
    ***************************************/
    function change_massupdate_button(){
    var btn = document.getElementById('update_button');
    btn.onclick = function(){
    alert('aaaaa');
    }
    }


    /**/
    addLoadEvent(change_massupdate_button);

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 0
    Last Post: 2009-05-19, 09:19 AM
  2. Customize Edit button
    By piccirm in forum Developer Help
    Replies: 1
    Last Post: 2009-01-29, 04:28 AM
  3. submitting a hidden field as part of note update
    By rustyw007 in forum Developer Help
    Replies: 3
    Last Post: 2008-06-12, 05:43 PM
  4. Replies: 3
    Last Post: 2008-06-03, 02:31 PM
  5. Replies: 0
    Last Post: 2007-06-16, 02:20 PM

Tags for this Thread

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
  •