We get a lot of great questions in the forums, and some even better answers. Here’s question we had recently…
I have an editview with a relationship field on it. When a selection is made, I need a value from the related record to populate another text/number field on the editview.
I have tried implementing field_to_name_array in the relationship field’s displayParams, but that only seems to work when the relationship field is populated from the search popup. I need it to populate once a quicksearch result is selected.
I can’t tell you how many people have been struggling with this sort of thing, as the popup and quicksearch use different configurations to do this. Fortunately, Jeff Bickart, a prolific community member and CTO at Sugar Gold Partner NEPO Systems, stepped in with this great answer…
This is a bit trickier: what you need to do is update the vardef using an Extension
$dictionary["MODULE"]["fields"]["FIELD"]["populate_list"] = array( "name","id", "opportunity_num", ); $dictionary["MODULE"]["fields"]["FIELD"]["field_list"] = array( "opportunities_name","opportunities_id", "parent_opp_no"), );
They way that it works is that populate_list contains all the fields that you want to copy from the relate module. the field_list is the list of fields on the screen.
Thanks Jeff for jumping in with the great answer to the poster’s issue!