CRM Open Source Business & Social CRM Software

Results 1 to 7 of 7

Thread: Modifying field attributes not accessible in Studio

  1. #1
    clint's Avatar
    clint is offline Sugar Team Member | Forums Lead Moderator
    Join Date
    Aug 2004
    Location
    Silicon Valley
    Posts
    2,116

    Default Modifying field attributes not accessible in Studio

    Studio allows you to create new fields, but not modify the existing core fields. Also, not all attributes of a field can be set in Studio. This tutorial shows you how to set field attributes via code in the custom directory.

    Let’s say you want to modify the Industry field in Accounts to 1) not display in the Mass Update form and 2) be required.

    To do this, simply create the file custom\Extension\modules\Accounts\Ext\VarDefs\Exam ple.php, add the following code below, and run Admin->Repair->Quick Repair and Rebuild.

    PHP Code:
    <?php
       $dictionary
    ['Account']['fields']['industry']['massupdate'] = false;
       
    $dictionary['Account']['fields']['industry']['required'] = true;
       
    ?>
    One note. It’s a little tricky packaging up these changes in a loadable module. You have to use the relationships part of the manifest file. Attached is a sample module that shows you how to do this. Take a look at the manfest file to see how to define these vardef changes.
    Attached Files Attached Files
    Last edited by clint; 2008-09-09 at 10:29 PM.
    Sugar Developer Zone - developer resources | Sugar University - user and admin training
    Sugar Docs - user and admin documentation |
    Sugar Bug Tracker - Enter or view bugs
    SugarForge- open source modules, themes, lang packs | SugarExchange - commercial extensions

    Clint Oram
    Chief Technology Officer and Co-founder
    SugarCRM

  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,261

    Default Re: Modifying field attributes not accessible in Studio

    Hi Clint

    Thanks a lot for the tip.

    Will SugarCRM Development Teams modify the Studio to allow this kind of customization?
    Is it a desirable feature in next releases?

    Best regards
    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
    clint's Avatar
    clint is offline Sugar Team Member | Forums Lead Moderator
    Join Date
    Aug 2004
    Location
    Silicon Valley
    Posts
    2,116

    Default Re: Modifying field attributes not accessible in Studio

    yes, we are looking to add this into Studio in the future.
    Sugar Developer Zone - developer resources | Sugar University - user and admin training
    Sugar Docs - user and admin documentation |
    Sugar Bug Tracker - Enter or view bugs
    SugarForge- open source modules, themes, lang packs | SugarExchange - commercial extensions

    Clint Oram
    Chief Technology Officer and Co-founder
    SugarCRM

  4. #4
    dominikm is offline Member
    Join Date
    Sep 2008
    Posts
    6

    Default Re: Modifying field attributes not accessible in Studio

    Hello,

    I need to modify module opportunities - i did create the "example.php" with this code


    <?php
    $dictionary['Opportunities']['fields']['account name']['required'] = false;
    ?>

    neverthelles the field is still required. Any advice, please? thank you


    ps. i am running the Sugar appliances vmware with sugar crm 5.0.0b running on rlinux

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

    Default Re: Modifying field attributes not accessible in Studio

    Hi domini

    Where did you add this code?
    Into a installer as clint suggested or into the system? Inside which file? Did you run Repair Extension?

    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.

  6. #6
    willyboy73 is offline Member
    Join Date
    Jul 2008
    Posts
    14

    Default Re: Modifying field attributes not accessible in Studio

    Dear Sirs, I did exactly what you said for some fields in Accounts and Leads modules ... I directly put a file with code in extension/modules/mymodule/Ext/VarDef/Example.php... I ran quick repair ... I see a red * near of my fields but ... when I save my record with all empty fields .... the record is still saved !!!

    Does anybody know an easy way to set required fields in Sugar CRM wich, to me, is a very important point and asked in every project !

    Thanks a lot !

  7. #7
    dominikm is offline Member
    Join Date
    Sep 2008
    Posts
    6

    Default Re: Modifying field attributes not accessible in Studio

    Hello,

    i do not understand the question ...i did add the file example.php in the path custom\... as suggested. i did use the repair and rebuild (and repair extensions). still unsuccesful.

    What do you mean exactly by installer please? thanks a lot

    Dominik

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. how do i create a custom field without using studio?
    By schnagga in forum Developer Help
    Replies: 3
    Last Post: 2008-05-30, 08:51 AM
  2. Replies: 3
    Last Post: 2007-02-28, 02:56 PM
  3. Replies: 0
    Last Post: 2006-11-09, 04:04 PM
  4. Replies: 2
    Last Post: 2006-07-30, 02:34 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
  •