Php 通过REST创建发票行项目
我可以成功地创建发票,但似乎无法为其创建行项目。 我将从何处获取列在行项目上的产品 目前我正在做:Php 通过REST创建发票行项目,php,rest,sugarcrm,suitecrm,Php,Rest,Sugarcrm,Suitecrm,我可以成功地创建发票,但似乎无法为其创建行项目。 我将从何处获取列在行项目上的产品 目前我正在做: $aProductResult = $SuiteCRM->setRelationship('AOS_Invoices', $aInvoiceResult['id'], 'aos_invoices_aos_product_quotes', '11173ff5-67a3-210d-030f-58fff7b9c3e0'); 返回 数组([已创建]=>0[失败]=>1[已删除]=>0)[/quot
$aProductResult = $SuiteCRM->setRelationship('AOS_Invoices', $aInvoiceResult['id'], 'aos_invoices_aos_product_quotes', '11173ff5-67a3-210d-030f-58fff7b9c3e0');
返回
数组([已创建]=>0[失败]=>1[已删除]=>0)[/quote]
我将ID更改为products\u quote,更改为products,但它从未创建关系
当我打印数据时,它似乎也很好:
Array
(
[session] => ku72sbgi87886onav0vsto8n73
[module_name] => AOS_Invoices
[module_id] => d615a339-44f4-79f7-6db0-5902f5d96fd9
[link_field_name] => aos_invoices_aos_product_quotes
[related_ids] => Array
(
[0] => 11173ff5-67a3-210d-030f-58fff7b9c3e0
)
)
我想这只是关系到该关联哪些ID以及使用哪些ID?
我正在使用行项目记录存储相关模块及其id,而不是试图通过关系调用链接这些模块。设置行项目记录上的字段可能会更幸运
也就是说,在创建/更新
AOS\U产品报价记录时,设置'parent\u type'=>'AOS\u Invoices'
和'parent\u id'=>'TheInvoiceId'
。现在在初始生成中似乎工作正常。