我正在尝试使用SugarCRM的遗留REST来获取一个单独的账单记录和一些特定字段。我正在处理SuiteCRM,他们使用相同的遗留REST调用。我还有一个和这个类似的预言,它能很好地工作。唯一的问题是,这个只会返回所要求的信息,而不是我在link_name_to_fields_array中调用的关系。
提前谢谢。如果需要更多的信息,请告诉我。
我遵循了这个例子,这里
我的代码如下
foreach ( $uids as $uid ) {
//retrieve records -----------------------------------
$get_entries_parameters = array(
//session id
'session' => $session,
//The name of the module from which to retrieve records
'module_name' => 'fs_payments',
//An array of SugarBean IDs
'ids' => array(
$uid
),
'query' => "",
'order_by' => "",
'offset' => "0",
'link_name_to_fields_array' => array(
array(
'name' => 'fs_billing_fs_payments_1',
'value' => array(
'first_name',
'qb_studentid'
),
),
),
);我只是做了一个API调用来获取所有的链接,我确实确认了链接名应该是什么,并且没有理由它应该返回一个空数组。
Linked Fields for fs_payments
fs_billing_fs_payments_1
[name] -> 'fs_billing_fs_payments_1'
[type] -> 'link'
[relationship] -> 'fs_billing_fs_payments_1'
[module] -> 'fs_billing'
[bean_name] -> 'fs_billing'有谁有一个比这更好的例子(如下面所示),因为在我看来,它对客户关系管理中的真正关系/链接的名称没有多大帮助,比如“fs_billing_fs_payments_1”,并且似乎不像示例所示的那样起作用。
$get_entries_parameters = array(
//session id
'session' => $session_id,
//The name of the module from which to retrieve records
'module_name' => 'Accounts',
//An array of record IDs
'ids' => array(
'14b0c0ca-3ea2-0ee8-f3be-50aa57c11ee7',
),
//The list of fields to be returned in the results
'select_fields' => array(
'name',
'billing_address_state',
'billing_address_country'
),
//A list of link names and the fields to be returned for each link name
'link_name_to_fields_array' => array(
array(
'name' => 'email_addresses',
'value' => array(
'email_address',
'opt_out',
'primary_address'
),
),
),
//Flag the record as a recently viewed item
'track_view' => true,
);发布于 2015-01-08 16:42:13
我能够使用构建在suiteCRM中的suiteCRM和bean关系来提取qb_studentid和accoutingclass,并使用单独的函数将它们设置为隐藏字段,以便在使用实际api调用中的get条目来获取大型数组时,它们将显示在数组中。使用逻辑钩子调用此文件,以确保在同步支付后提取所有qb_student ID。如果您需要更多关于这方面的细节,请随时通知我。我与这个问题斗争了一段时间,仍然没有任何答案,从任何人不在这里,也没有在sugarcrm或suitecrm社区论坛。这是一个更好的解决办法。
发布于 2014-12-31 05:43:46
您在link_name_to_fields_array中传递了错误的链接名。
您的链接字段名为fs_billing_fs_payments_1,但您正在传递fs_billing_fs_payments_1_c。
https://stackoverflow.com/questions/27693853
复制相似问题