Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: Creating an upload fiels in Module builder

  1. #1
    shan1111 is offline Sugar Community Member
    Join Date
    Apr 2008
    Posts
    21

    Default Creating an upload fiels in Module builder

    Hi

    Does anyone know how to create a field in the the module loader to the documents module, i am trying to create and upload file field

    Thanks in Advance

    Cheers
    Shannon

  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: Creating an upload fiels in Module builder

    Hi, Shannon

    I believe you can create a file_upload field as a varchar field and into editviewdefs, add the attribute "type" => 'File'.
    It automatically create into EditView a fileupload field with file selector.
    I´m not sure it automatically upload the file, but you can try this.

    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
    shan1111 is offline Sugar Community Member
    Join Date
    Apr 2008
    Posts
    21

    Default Re: Creating an upload fiels in Module builder

    Thanks i will give it a go

  4. #4
    cindyglackin is offline Junior Member
    Join Date
    Apr 2008
    Posts
    1

    Default Re: Creating an upload fiels in Module builder

    Shannon,

    Did this work? I am trying to create the same type of field.

  5. #5
    shan1111 is offline Sugar Community Member
    Join Date
    Apr 2008
    Posts
    21

    Default Re: Creating an upload fiels in Module builder

    Hi I actually ran short of time and worked around my issue another way

    Shannon

  6. #6
    balth is offline Sugar Community Member
    Join Date
    Apr 2008
    Posts
    23

    Default Re: Creating an upload fiels in Module builder

    Quote Originally Posted by andopes
    Hi, Shannon

    I believe you can create a file_upload field as a varchar field and into editviewdefs, add the attribute "type" => 'File'.
    It automatically create into EditView a fileupload field with file selector.
    I´m not sure it automatically upload the file, but you can try this.

    Cheers.
    Hi all,
    I try to do the same thing but unfortunatelly :
    - Varchar type doesn't exist anymore for fields (I use SugarCRM CE Version 5.0.0d )
    - Into" editview" (from "Module Builder" I think) I don't understand how to add the attribute "type" => 'File'.

    Can You give us more details please?
    Thanks in advance for answer !

  7. #7
    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: Creating an upload fiels in Module builder

    Quote Originally Posted by balth
    Hi all,
    I try to do the same thing but unfortunatelly :
    - Varchar type doesn't exist anymore for fields (I use SugarCRM CE Version 5.0.0d )
    - Into" editview" (from "Module Builder" I think) I don't understand how to add the attribute "type" => 'File'.

    Can You give us more details please?
    Thanks in advance for answer !
    Hi, balth

    You can create a Text field, not text area, it is the same of varchar
    Inside the editviewdefs, exactly where you want to render the field you can put this code:

    PHP Code:
        array (
            array(
                
    'name'=>'file_upload',
                
    'type'=>'File',
        ), 
    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.

  8. #8
    balth is offline Sugar Community Member
    Join Date
    Apr 2008
    Posts
    23

    Default Re: Creating an upload fiels in Module builder

    Thanks for answer andopes,

    but it doesn't work to me....
    adding "'type'=>'File', " in my editviewdefs.php doesn't change anything...
    And after learning some code from document module (for example), it seem more complicated than just adding "'type'=>'File', " into a file...

  9. #9
    balth is offline Sugar Community Member
    Join Date
    Apr 2008
    Posts
    23

    Smile Re: Creating an upload fiels in Module builder

    Hi all,

    Answer to the problem is to edit your vardef.php file in /var/www/your_sugar_dir/modules/your_mod_dir/

    PHP Code:
    'bmfb' =>         <<MY PERSONAL FIELD 
    array (     'required' => false,     
    'name' => 'bmfb',     
    'vname' => 'LBL_BMFB',    
    'type' => 'file',                    << CHANGE HERE REPLACE "varchar" BY "file"
    'massupdate' 
    => 0,     
    'comments' => '',     
    'help' => '',    
    'duplicate_merge' => 'disabled',     
    'duplicate_merge_dom_value' => 0,     
    'audited' => 0,     
    'reportable' => 0,     
    'len' => '255',   ), 
    Then repair your module (without repairing database) and it's done...

  10. #10
    eggsurplus's Avatar
    eggsurplus is offline Sugar Community Member
    Join Date
    Dec 2005
    Location
    Minnesota
    Posts
    2,343

    Default Re: Creating an upload fiels in Module builder

    This isn't upgrade safe but the attachment will let you create file custom field types in Studio.

    Use only if you're sure of what you're doing on a test environment. Just unzip and copy into Sugar. Based on 5.0.0c.
    Attached Files Attached Files

Page 1 of 2 12 LastLast

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Creating new module with module builder...
    By NPayette in forum Developer Help
    Replies: 5
    Last Post: 2009-05-27, 03:51 PM
  2. Module Builder
    By Olavo in forum Downloads
    Replies: 418
    Last Post: 2009-02-26, 06:36 AM
  3. Replies: 12
    Last Post: 2008-03-03, 06:27 PM
  4. Replies: 1
    Last Post: 2006-10-12, 12:07 AM

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
  •