问题
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?
Thanks!
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;
}
回答1:
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!
来源:https://stackoverflow.com/questions/30109471/how-would-i-search-location-based-on-primary-keys-such-as-baccountid-and-locat