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

Thread: Displaying custom fields from one module on another.

  1. #1
    rsantiago is offline Sugar Community Member
    Join Date
    Feb 2006
    Posts
    55

    Question Displaying custom fields from one module on another.

    Hello All

    I have a few custom fields i created for the leads tab and would like to display those fields on another module... how would i go about doing this?

    Thanks a ton!

  2. #2
    rsantiago is offline Sugar Community Member
    Join Date
    Feb 2006
    Posts
    55

    Default Re: Displaying custom fields from one module on another.

    I can seriously use some help. Anyone that may be able to at least guide me on the right path... i'd really appreciate it.

  3. #3
    rsantiago is offline Sugar Community Member
    Join Date
    Feb 2006
    Posts
    55

    Default Re: Displaying custom fields from one module on another.

    Can someone tell me if this is even possible?

    There seems to be tons of other threads posing this same question, and none of them have ever been responded too. I'm sure this would be quite usefull information for the average SugarCRM user.

  4. #4
    rsantiago is offline Sugar Community Member
    Join Date
    Feb 2006
    Posts
    55

    Default Re: Displaying custom fields from one module on another.

    Anyone out there able to help me out?

  5. #5
    stevec is offline Sugar Community Member
    Join Date
    Oct 2005
    Location
    London
    Posts
    1,100

    Default Re: Displaying custom fields from one module on another.

    If you mean reuse dropdowns, you can - just create the new fields in the new modules based on the same custom dropdown.

    Or do you mean shown fields from one module that is related to another? Eg. Show the account's city in a related contact's oportunity?

    Or as you refer to leads, do you mean take over some custom fields when that lead is modified into an account proper?

  6. #6
    rsantiago is offline Sugar Community Member
    Join Date
    Feb 2006
    Posts
    55

    Default Re: Displaying custom fields from one module on another.

    Or do you mean shown fields from one module that is related to another? Eg. Show the account's city in a related contact's oportunity?

    Or as you refer to leads, do you mean take over some custom fields when that lead is modified into an account proper?
    Both actually. Lets say i have a custom field in the LEADS module for "Opener"; i would like to be able to take that field and also be able to use it in the ACCOUNTS module, so if a change is made to the "Opener" field in the leads module, the changes will also reflect in the accounts module, and vice versa.

    I would like to know how to do this for both dropdown and data fields.

    Your advice on dropdowns will not allow changes made to the field in one module to be reflected in another, so that particularly is not what i am looking to achieve.

    Thanks again for your help.

  7. #7
    agupta is offline Sugar Team Member
    Join Date
    May 2005
    Posts
    142

    Default Re: Displaying custom fields from one module on another.

    Follow these steps to implement this use case that you outlined:

    1. Add a custom field to leads module.
    2. Add another custom field to accounts module.
    3. To sync values across modules you will need to write some php code.
    3a. open lead.php in an editor and locate the save method, if it does not exist copy save methods signature from sugarbean.php
    3b. In this method you can update the value of custom field in accounts table. update the table directly instead of using an instance of other bean to do it.
    3c. do the same modification in Accounts.php.


    -Ajay

  8. #8
    rsantiago is offline Sugar Community Member
    Join Date
    Feb 2006
    Posts
    55

    Default Re: Displaying custom fields from one module on another.

    1. Add a custom field to leads module.
    2. Add another custom field to accounts module.
    3. To sync values across modules you will need to write some php code.
    3a. open lead.php in an editor and locate the save method, if it does not exist copy save methods signature from sugarbean.php
    3b. In this method you can update the value of custom field in accounts table. update the table directly instead of using an instance of other bean to do it.
    3c. do the same modification in Accounts.php.
    Ajay,

    While i am extremely appreciative of your response, i unfortunately am somewhat of a beginner when it comes to SugarCRM and PHP coding and could use some more precise instructions in order to achieve these necessary changes.

    I would greatly appreciate any help offered by yourself or any other SugarCRM user.

    Thanks in advance.

  9. #9
    stevec is offline Sugar Community Member
    Join Date
    Oct 2005
    Location
    London
    Posts
    1,100

    Default Re: Displaying custom fields from one module on another.

    For further info - if you want a custom field in leads to update the same or another field in the subsequently created account during the convert process, you could do the following: (this is based on a quick hack I did to populate fields when creating a new record from a 'previous' screen)

    1. Edit modules/Leads/DetailView.html
    At the top, you will see the DetailView form. this determines what values are posted on the edit, duplicate, delete or convert buttons. Just add a line for the custom variable eg:

    Code:
    <input type="hidden" name="my_custom_var1" value ="{lead_custom_opener_field_c}">
    Pick the appropriate custom field name as you have defined it. In this example it's: "lead_custom_opener_field_c".
    Now, on the next PHP page, that value will be in the variable $_REQUEST["my_custom_var1"] where you can use it to seed one of the form fields. If it's a dropdown, make sure the form had a custom field with the same custom dropdown assigned. If it's a text field, just drop it in. In modules/Leads/ConvertLead.php, before the "$xtpl->parse("main....." command in the section you want the field added, add something like:

    Code:
    if (!empty($_REQUEST["my_custom_var1"])) { //make sure you have a value
            
      $xtpl->assign("OPTIONS_LEAD_CUSTOM_OPENER_FIELD_C", get_select_options_with_id($app_list_strings['custom_openers'], $_REQUEST["my_custom_var1"]));
    
    }
    where you are updating a custom dropdown (custom_openers). Or if you are just updating a field - do it like:

    Code:
    if (!empty($_REQUEST["my_custom_var1"])) { //make sure you have a value
            
      $xtpl->assign("LEAD_CUSTOM_OPENER_FIELD_C", $_REQUEST["my_custom_var1"]);
    
    }
    This all assumes that you have modified the ConvertLeads.html file with the new custom fields for the account. Unless if you just want to add the custom lead field to an existing account field, in which case, you can just update the existing one.

    Hope this helps
    Last edited by stevec; 2006-09-08 at 10:34 AM.

  10. #10
    rsantiago is offline Sugar Community Member
    Join Date
    Feb 2006
    Posts
    55

    Default Re: Displaying custom fields from one module on another.

    Is it possible to have someone edit the appropriate pages for me, there are a couple of fields (text and dropdown), that i need to display on the lead, account and opportunity tabs and this seems a bit over my head for me to accomplish on my own. I am willing to pay a fee to have this done as well.

    Please respond if you are willing, thanks.

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)

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
  •