Results 1 to 3 of 3

Thread: Possible to pull value from module?

  1. #1
    p_unterberg is offline Member
    Join Date
    Feb 2010
    Posts
    15

    Default Possible to pull value from module?

    Hi,

    I have a custom contacts subpanel on the accounts page that has a button.
    When you click the button, I am able to use the $layout_def['fields'][<field name>] to get the value of that field
    for the contact record and pass it to a URL that opens.

    For example, I can pass the Contact's first and last name.


    However, I wanted to get a field value from the account record that's displayed in the account section. For example, I have a field call account_code_c.

    Is there a similar mechanism to the $layout_def that I can use to read the account?

  2. #2
    kbrill's Avatar
    kbrill is offline SugarCRM PS Engineer
    Join Date
    Jul 2004
    Location
    St Louis, MO
    Posts
    3,183

    Default Re: Possible to pull value from module?

    Not enough here to really tell what you are doing, will need some screenshots or maybe some code to really see what you are talking about.
    Kenneth Brill - Help Forum Moderator

    I do not respond to 'Private Messages'. Please email me directly instead

    When asking for help, PLEASE give us your Server Information and Version Numbers as asked for on the 'Post New Message' screen as well as any JavaScript errors shown at the bottom of the browser window.
    Help us Help You

  3. #3
    datasponge is offline Sugar Community Member
    Join Date
    Mar 2008
    Location
    San Jose, CA, USA
    Posts
    553

    Default Re: Possible to pull value from module?

    Hi p_unterberg,

    I create a link on Accounts Detail View using custom code in detailviewdefs.php.

    In my case, I pass the Account ID in the Get String of the URL for a link and display the link next to the Account Name in Detail View. I don't use a button.

    Just add a customCode line to custom/modules/Accounts/metadata/detailviewdefs.php like the one in the code below:

    PHP Code:
        'panels' => 
        array (
          
    'default' => 
          array (
            
    => 
            array (
              
    => 
              array (
                
    'name' => 'name',
                
    'label' => 'LBL_NAME',
                
    'customCode' => '{$fields.name.value} &nbsp;<a href="http://192.168.254.7/sugaracctinfo.php?AcctID={$fields.id.value}" target="_blank"><small>Zoom</small></a>',
              ), 
    Notice that you can reference the $fields array element in braces {$fields.name.value} to extract the desired field value. Note that I also display the name itself first using '{$fields.name.value}') so that the custom code does not replace the actual name field itself, but appears after it.

    Phil

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. pull out lead assignee
    By lukesdyer in forum Developer Help
    Replies: 0
    Last Post: 2010-02-05, 09:29 PM
  2. How to create a dynamic pull-down list?
    By DiscoverC in forum Developer Help
    Replies: 2
    Last Post: 2008-11-26, 03:29 PM
  3. Pull in outside data
    By mlhess in forum Developer Help
    Replies: 4
    Last Post: 2007-01-23, 10:36 PM
  4. Pull in column to listview
    By twisted in forum Developer Help
    Replies: 5
    Last Post: 2006-08-28, 04:08 PM
  5. HELP ME......going to pull out my hair
    By fxnightlife in forum Help
    Replies: 1
    Last Post: 2005-11-11, 05:55 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
  •