Results 1 to 1 of 1

Thread: You CAN massupdate non-dropdown fields

  1. #1
    tj@estreet.com is offline Sugar Community Member
    Join Date
    Feb 2006
    Posts
    163

    Default You CAN massupdate non-dropdown fields

    Okay, we know you can add a dropdown for a custom field to the massupdate subpanel by ticking the massupdate checkbox in the custom field editor (though it proabably wont update=) and we know you can add a sugar field to the massupdate subpanel by setting ('massupdate' => false, or 'massupdate' => 1) in the module's vardefs -- IF it is type enum, but untill now no one has offered a means by which to massupdate NON-DROPDOWN fields, SO HERE IT IS.

    While, without a risky and major re-write of some really tricky code, you can't add non-dropdown fields to the Sugar massupdate sub-panel, you CAN -- pretty easily -- add your own massupdate fields -- of ANY TYPE -- at the end of your modules ListView.html. ...at least in Sugar OS 4.0.x

    Example:
    In contacts/vardefs I have added two "custom" feilds ('cycle', and 'gag'[Grip and Grin], but OEM sugar fields should work as well.
    Notice the type, and the complete absense of any massupdate or options strings.
    vardefs.php
    PHP Code:
    'cycle' => 
     array (
    'name' => 'cycle',
    'vname' => 'LBL_CYCLE',
    'type' => 'int',
    'isnull' => 'false',
    'default_value' => '0',
     ),

    'gag' =>
    array (
    'name' => 'gag',
    'vname' => 'LBL_GAG',
    'type' => 'bool',
    'dbType' => 'varchar',
    'len' => '3',
    'default' => '0',
    ), 
    ListView.html
    HTML Code:
    <!-- END: row -->
    {PAGINATION}
    </table>
    
    <table cellpadding='0' cellspacing='0' border='0' width='100%'>
    
    <tr>
    <td style='padding-bottom: 2px;'>
    <input type='submit' name='Update' value='Update GAG/Cycle' class='button'>
    {MOD.LBL_CYCLE}&nbsp; <input type="text" size="1" id="mass_cycle" name="cycle">&nbsp; 
    {MOD.LBL_GAG}&nbsp; <input type="checkbox" size="1" value="1" id="mass_gag" name="gag">
    </td>
    </tr>
    </table>
    The addidion of the "Update" button is redundant, as the button in the subpanel will update these fields as well, but I added it in this case, changing the button value to 'Update GAG/Cycle' in an effort to save on user confusion (otherwise not obvious that your added update fields [outside the sub-panel] are also massupdate fields)
    Attached Images Attached Images  
    Last edited by tj@estreet.com; 2006-10-03 at 05:04 PM.

Thread Information

Users Browsing this Thread

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

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
  •