我正在编写SOAP服务以获取Java中帐户的所有联系人。 我刚刚找到了get_relationships(..)方法。
但它没有像我预期的那样工作。我肯定有与该帐户相关的联系人,我测试了这个直接查询数据库。
我发现了documentation
而且我真的不明白这个字段的含义:related_module_link_name_to_fields_array
我做错了什么?
accountID="cad15b8a-d70b-13eb-f295-55ca158ec988"
String query = "";
String[] relatedFields= new String[]{"first_name", "last_name", "email1"};
Link_name_to_fields_array[] linkedFields = new Link_name_to_fields_array[]{null};
String orderby = "";
resultVersion2 = binding.get_relationships(sessionID, "Accounts", accountID, "contacts", query, relatedFields, linkedFields , 0, orderby);
这是我从php到java的引用示例的翻译:
Link_name_to_fields_array[] linked = new Link_name_to_fields_array[]{new Link_name_to_fields_array("contacts", new String[]{"id", "first_name", "last_name"})};
binding.get_relationships(sessionID, "Accounts", "400808a8-7f3a-39d9-abfd-557aed2f9a89",
"opportunities", " opportunities.name IS NOT NULL ", new String[]{"id", "name"}, linked, 0, orderby);