我将如何搜索“位置”基于主键,例如通过Web Service API的BAccountID和LocationID? [英] How would I search "Location" based on primary keys such as BAccountID and LocationID through Web Service API?
问题描述
正如我在是否有任何方法可以在搜索企业帐户时获取BAccountID,或通过Web Service API根据这些主键更新企业帐户?,我试图获取主键值,例如<$ BAccount
表中的c $ c> BAccountID ,我这样做了-感谢@Stan的帮助-现在我需要搜索基于位置在 BAccountID
和 LocationID
上,它们是位置表中的两个主键;但是,我无法使其正常工作。
As I indicated in my another question at Is there any way to get BAccountID when searching Business Account, or update Business Account based on those primary keys through Web Service API?, I was trying to get Primary Key value such as BAccountID
from BAccount
table, which I did - thanks to @Stan 's help - now I need to search "Location" based on BAccountID
and LocationID
, which are two primary keys in "Location" table; however, I couldn't get it work.
有人可以帮我看看如何使它工作吗? @斯坦,你能再帮我吗?
Can somebody give me a help to show me how to get it work? @Stan, would you please help me again?
谢谢!
正如@ryanyuyu所建议的,以下是我试过但没用的方法:
As @ryanyuyu suggested, the following is what I tried but didn't work:
CR303010Content CR303010 = context.CR303010GetSchema();
context.CR303010Clear();
List<Command> cmds = new List<Command>();
cmds.Add(CR303010.LocationSummary.ServiceCommands.EveryLocationID);
cmds.Add(CR303010.LocationSummary.LocationID);
cmds.Add(CR303010.LocationSummary.LocationName);
List<Filter> filters = new List<Filter>();
filters.Add(new Filter()
{
Field = NewA4Field(CR303010.LocationSummary.BusinessAccount.ObjectName, "BAccountID"),
Value = "8145",
Condition = FilterCondition.Equals,
Operator = FilterOperator.And
});
filters.Add(new Filter()
{
Field = NewA4Field(CR303010.LocationSummary.LocationID.ObjectName, "LocationID"),
Condition = FilterCondition.Equals,
Value = "9488",
});
var CR303010Export = context.CR303010Export(cmds.ToArray(), filters.ToArray(), 0, false, false);
public static apisalesorder.Field NewA4Field(string objName, string fldName)
{
apisalesorder.Field nv = new apisalesorder.Field();
nv.ObjectName = objName;
nv.FieldName = fldName.TrimEnd();
return nv;
}
推荐答案
按照@Gabriel的建议,我我将使用客户代码和位置代码来获取位置信息,如果我确实需要基于主键获取位置数据,我将改用通用查询。感谢加百列的帮助!
As @Gabriel suggested, I'm going to use Customer code and Location code to get Location info and if I do need to get Location data based on primary keys, I will use Generic Inquiry instead. Thanks for Gabriel's help!
这篇关于我将如何搜索“位置”基于主键,例如通过Web Service API的BAccountID和LocationID?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!