Can you pull related records when doing using ‘get_entry_list’ call to get a list of record? I am having problems using the link_name_to_fields_array option to get data from another module with which it has a one to many relationship.
Module A is Opportunities. Module B is Vehicles. One Vehicle is be related to many Opportunities.
When I do a get_entry_list call to get a list of opportunities I want to return the related vehicle with the opportunity.
I tried adding the field to the selected fields array and I tried link_name_to_fields_array option but neither is working. What am I doing wrong?
Code Below
$get_entry_list_parameters = array(
//session id
'session' => $session_id,
//The name of the module from which to retrieve records
'module_name' => 'Opportunities',
//The SQL WHERE clause without the word "where".
'query' => 'sales_stage IN ("Sent","Completed","Trip")',
//The SQL ORDER BY clause without the phrase "order by".
'order_by' => "",
//The record offset from which to start.
'offset' => '0',
//Optional. A list of fields to include in the results.
'select_fields' => array(
'trapsort_unit_c',
'name',
'id',
'v_vehicles_module_opportunities_1_name'
),
/*
A list of link names and the fields to be returned for each link name.
Example: 'link_name_to_fields_array' => array(array('name' => 'email_addresses', 'value' => array('id', 'email_address', 'opt_out', 'primary_address')))
*/
'link_name_to_fields_array' => array(array('name'=>'v_vehicles_module_opportunities_1','value'=>array('name','id'))),
//The maximum number of results to return.
'max_results' => '1',
//To exclude deleted records
'deleted' => '0',
//If only records marked as favorites should be returned.
'Favorites' => false,
);