Auto populate primary email address from relate module

Hi guys, 

I'm working in sugar 8.3. I have one relate field in opportunity with contact module. I want to auto populate contact primary email in text field and  dropdown value in text field from contact. I tried with vardef auto populated option. but its not working. its showing "[Object][Object]" in email text field and for dropdown value its showing original value with underscore (ex. abc_xyz), But I want to show like (abc xyz)..

thanks,

  • Hi Juned,

    Not sure if this exactly matches your use case, but it sounds related at least. 

    This is all done through Studio -- I added a Contact Relate field to the Opportunity module and called this "Primary Contact". Then I created a separate Text field called "Primary Email" and used this formula as the calculated value:

    related($contacts_opportunities_1,"email1")

    "Primary Email" now displays the primary email of the Contact selected in "Primary Contact". The key part is "email1" - after some testing, I found that "email1" was how Sugar would successfully find the primary email address.

    It was a while back, so I don't remember exactly... but I believe the Relationship table automatically added the relationship "contacts_opportunities_1" and it was just a matter of looking at the table to find the correct relationship name to use in the formula.

    I'm not exactly sure what you're trying to do with the dropdown part of your question. I have had success using Studio to copy values from a dropdown to text fields as a calculated value with this general formula:

    getDropdownValue("lead_source_dom",related($contacts_opportunities_1,"lead_source"))

    "lead_source_dom" is the drop down list name, "lead_source" is the field name in the target module.