How can I display a field from one module in a different module?

I am running SugarCRM Professional, Version 7.2.  I want to add a field to a layout in the calls module, but the field I want to add is a Studio created field from a different module.  I searched the old Sugar vt bulletin forums and found lots of people talking about editing the php files and creating all kinds of relationships, but no one clearly said whether it can be done strictly via Studio.  This site seems less techie, but I have not found an answer here either.  Can I (without editing any source files manually or installing JavaScript files) make a field created for one module available for the layout of a screen in another?  It sure seems like something lots of people would want to do.  Thanks for any help I get (even if the answer is that it cannot be done).
  • This reply was created from a merged topic originally titled  How do I show a field from the Leads module in the Tasks/Calls module list view?.  I have been bashing my head against this for days. I'm not a developer at all and there is some fundamental knowledge and/or skills I am missing here.

    What I want to do is, I believe, simple. I want take the "account_name" field (I use it for the Company Name) from the "Leads" module and display it in the "Tasks" and "Calls" modules, specifically in list view. At present, the "tasks" and "calls" modules only show the lead contact name—that is, the individual's name and not the company name. I don't always remember which lead contact is associated with which company and I frequently have to click to the "leads" module to see who is associated with which company. This is pointless clicking.

    Here's an illustration:

    In the "Leads" module you have data such as: name, status, account name, phone, etc:




    Here's what I'd like to happen. I inserted a dummy field to illustrate.



    The calls/tasks module simply fulls data from the Leads/account_name field like this:



    The data exists in this field:



    It seems this should be simple. I've tried "relate" fields but it only allows me to include the name of the lead and not the account name from the lead. Any help would be appreciated.
  • Hi reluctant data and Paul,

    The functionality you are looking to achieve can be easily achieved with Sugar Logic which is a formula-based engine akin to Excel formulas. Since Paul's example is looking for a specific use, I will highlight his use case in the steps to achieve this functionality:
    1. Go to Admin > Studio > Calls > Fields > Add Field
    2. Create a text field called lead_account_name and on that field creation screen, check the 'Calculated Value' box and then 'Edit Formula':

    3. A formula builder window will pop up and on that pop-up, click the 'Related Field' button.
    4. Once that is clicked, set the module to 'Leads' and the field to 'Account Name', and then click 'Insert'

    5. This action will automatically create the necessary formula into the builder and then you can click 'Save' to return to the field creation.
    6. Click 'Save' again to finalize creating your field
    7. Remaining in Studio, go to Calls > Layouts > List View
    8. Locate the newly created field in the far right column and drag it over to the desired location in the first column labeled 'Default'.

    9. Click the 'Save & Deploy' button to publish the new layout.
    10. Create a call associated to a lead and see that the list view displays the expected information!

    With the above steps, you are all set to begin utilizing the new functionality. A couple notes towards understanding this feature:
    • This will only display data on records created or saved after the field is created. 
    • While the example above deploys the field to the list view, you can also deploy the field to any other available view in the module.
    • If you implement a significant number of calculated fields using related formulas on a module, you can negatively impact the performance when saving or mass updating records as these formulas need to perform backend calls to the other module(s) to retrieve and update the data.
    • Using these calculated fields is best done when you are only expecting a singular relationship to exist between the two modules. For instance, if I created a call with 2 leads as an attendee on the same call, then the account name retrieved by the formula would be arbitrary. If you need to pull specific data from a related record when other related records may also exist from the module, a custom logic hook is recommended.
    I hope this helps and please let me know if you have any questions!

    Kind regards,

    Chris
  • ...can negatively impact the performance when saving or mass updating records 
    (includes importing via wizard and updating/creating via the API).
    Any other inputs on calc fields / logic hooks /  workflow impacts on performance?
  • Your solution seems so easy, BUT when I go to the formula builder, the module that has the fields I need is not listed.  I see many others, but not the one I need.  I tried to fake the formula by adding one to see the format, which turns out to be:
    related($opportunities,"date_entered")

    I changed it to the right module name and field label but when I click save, it says UNKNOWN FIELD: MEETINGS (meetings is the module that is not appearing on the list).  I know I have the actual field name correct since I compared the format to one that does work, so it must still be complaining about the module name.

    Next, I poked around looking for any screen that might show a list of modules associated with the one I am trying to edit.  The relationships do not match what I see  as available modules, nor does any other list.  It is as though the Meetings module is just hidden somehow.

    If you or anyone has any extra advice on how to make a module appear on the list, I welcome it.
  • Hi reluctant data,

    Is the module you are trying to inject this field into a custom module or a stock module? If it is custom, did you build the module through Module Builder or install it from a third party? If you created a direct relationship to Meetings or the "Activities" suite of modules via Studio or Module Builder, then the relationship should be available for selection in the formula builder.

    The modules that appear in the dropdown are based off the established relationships recognized between two modules so the absence of Meetings would likely indicate that either a direct relationship does not exist between the two modules or the relationship is not properly defined. If you go to Admin > Studio > {Module Name} > Relationships, you should see Meetings listed as a related module like the following:

    Or:


    Kind regards,

    Chris
  • Great point about the impact towards importing and API calls as well! In general, logic hooks are seen as a more scalable and better performing solution when looking to interact with a large amount of data between modules.
  • Yes, I was about to post an "OOPS, I found the relationship I needed" message.  I compared one that WAS working to the one that was not to find my mistake.  Thank you so much!
  • Hi,
    I am getting error like invalid formula. i am posting the screen shot.



  • Hi Chris,

    As you said as part of your answer “This will only display data on records created or saved after the field is created.” Unfortunately you are correct!  Is there any way to get this to work on existing records? I am working to a 31 Dec deadline and need to create a contact list using this added feature. Maybe there is a way to do a bulk edit and save on all of my contacts? Your help and direction would be very much appreciated.