AnsweredAssumed Answered

Exporting relationship fields in Leads

Question asked by Yury Voloshin on Sep 17, 2018
Latest reply on Sep 19, 2018 by Yury Voloshin

In Leads module, I have One-to-Many relationships called leads_assigned_user and campaign_leads. The first one is a user assigned to a lead and the second one is a campaign associated with a lead. In List view, the assigned user is shown as a column with the full name of the user, and the campaign is the name of a campaign. When I export Leads to a CSV, the assigned user is exported as the user's name. But, the campaign is exported as the campaign's ID, which is not at all user-friendly. Where can I find the code that forces the assigned user to be exported as a name and the campaign to be exported as ID?

I need to modify the exporting process to export the campaign as a name. Some recommendations for doing this involve overriding the create_export_query method in SugarBean.php. Is this the best way to do it? If so, where should I place the overriding code? Should this code be an extension of the SugarBean class? 

Thank you for any help!

Outcomes