Results 1 to 7 of 7

Thread: Newbie - Missing something obvious

  1. #1
    RLJB is offline Senior Member
    Join Date
    Oct 2008
    Location
    Sydney - Australia
    Posts
    21

    Default Newbie - Missing something obvious

    Hi All

    I've been using the module builder and studio to see what is possible without delving into code.

    I seem to be missing something obvious, in a newly created module I simply want to display/show a field from another module

    I have tried the following:
    1. Say there is a field for a mobile phone number called "phone_mobile" in an existing module called "contacts"
    2. I want to use this in a new module that I built using module builder called "performance"
    3. I use studio, open the fields in "performance"
    4. Click add field and add new text field called "phone_mobile" with all the same properties (eg phone field, 25 chars, etc) as the "phone_mobile" field in the "contacts" module

    It just creates the field but calls it "phone_mobile_c" - which it treats as a new and seperate field.

    I have tried using 1:1 relationship but I can only ever get the primary field to display ie "name"

    Surely you can display a field from another module using the studio/builder? What am I not understanding here?

    Thanks

    RLJB.

    OS = Windows Vista
    Suagar = Version 5.1.0b (Build 4905) Community Edition
    Apache / PHP / MySQL as installed by the fast stack installation

  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: Newbie - Missing something obvious

    Hi RLJB

    Using Module Builder you can create a new module, this you already know perfectly.
    Using Studio you can modify the existing modules (built in modules and custom modules), in an upgrade safe way the Studio create new fields into <table_name>_cstm table and the fields has the suffix '_c' to indicate this is a custom field. That is what is happening in your system.

    Let me understand your needs:
    You want to automatically copy the field phone_mobile from Contact to Performance module when selecting a Contact from the Relate field into Performance module.
    Right?

    If this is your needs so do the following:

    1. Edit the file cache/modules/Contacts/Contactvardefs.php
    2. Copy the phone_mobile definition from this file to modules/Performance/vardefs.php
    3. Copy the language entry for phone_mobile in the cache/modules/Contacts/language/<your_language>.lang.php to modules/Performance/language/<your_language>.lang.php
    4. Go to Admin -> Repair -> Rebuild Extension / Repair Database
    5. Edit the modules/Performance/metadata/editviewdefs.php and add this new definition at the end of the relate field to Contacts:

    PHP Code:
                'displayParams' =>
                array (
                  
    'field_to_name_array' => array(
                    
    'id' => '<id_field_of_contact>',
                    
    'name' => '<name_field_of_contact>',
                    
    'phone_mobile' => 'phone_mobile',
                  ),
                  
    'additionalFields' => array(
                    
    'phone_mobile' => 'phone_mobile',
                  ),
                ), 
    Replace the <id_field_of_contact> and <name_field_of_contact> by the properly values.

    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
    SugarDev.net is offline Sugar Community Member
    Join Date
    Feb 2008
    Posts
    1,401

    Default Re: Newbie - Missing something obvious

    nice andopes.

    Is this documented somewhere?
    Developers go here
    Businesses go there (Dutch)

    Modules:
    SugarDev.net Developer Tools | Config | Dutch Language Pack
    "Nothing gets fixed unless there is a bug"

  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: Newbie - Missing something obvious

    Yes, in my mind!



    I'm trying to get a precious free time to document some tricks I know.
    I have developed some good javascript tools to customize easily SugarCRM and I want to share it to community, but my free time had been focused on my wedding planning.
    Almost there, in January I'll get married!
    Last edited by andopes; 2008-11-05 at 05:02 PM.
    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
    eggsurplus's Avatar
    eggsurplus is offline Sugar Community Member
    Join Date
    Dec 2005
    Location
    Minnesota
    Posts
    2,343

    Default Re: Newbie - Missing something obvious

    Congrats Andopes! Hopefully you won't be bringing Sugar with you on your honeymoon!

  6. #6
    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: Newbie - Missing something obvious

    If I talk about Sugar on Honey Moon my wife certainly will kill me!
    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.

  7. #7
    RLJB is offline Senior Member
    Join Date
    Oct 2008
    Location
    Sydney - Australia
    Posts
    21

    Default Re: Newbie - Missing something obvious

    Thanks Andre - I will give it a go and report back on my success.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 11
    Last Post: 2008-07-30, 11:29 AM
  2. Newbie - Importing Leads from a CSV File
    By Matt Moreau in forum Help
    Replies: 3
    Last Post: 2007-09-07, 07:07 PM
  3. Administration / Upgrade.php - Missing Some Language Items
    By shware in forum Installation and Upgrade Help
    Replies: 0
    Last Post: 2006-10-18, 07:38 PM
  4. Replies: 1
    Last Post: 2006-09-11, 03:38 PM
  5. View Calendars in iCal
    By unteins in forum General Discussion
    Replies: 8
    Last Post: 2005-07-06, 02:12 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
  •