问题
I am using the AR303000 screen to search for a customer. If I add more than one filter only the first filter is applied. Also, the results set does not include the GeneralInfoMainAddress lines. This may be why the filter is not working.
AR303000Content AR303000 = context.AR303000GetSchema(); context.AR303000Clear();
List<Command> cmds = new List<Command>();
cmds.Add(AR303000.CustomerSummary.ServiceCommands.EveryCustomerID);
cmds.Add(AR303000.CustomerSummary.CustomerID);
cmds.Add(AR303000.CustomerSummary.CustomerName);
cmds.Add(AR303000.GeneralInfoMainAddress.AddressLine1);
cmds.Add(AR303000.GeneralInfoMainAddress.City);
cmds.Add(AR303000.GeneralInfoMainAddress.State);
cmds.Add(AR303000.GeneralInfoMainAddress.PostalCode);
List<Filter> filters = new List<Filter>();
filters.Add(new Filter()
{
Field = new Field()
{
FieldName = AR303000.CustomerSummary.CustomerName.FieldName,
ObjectName = AR303000.CustomerSummary.CustomerName.ObjectName
},
Condition = FilterCondition.Contain,
Value = "DOE, JOHN",
Operator = FilterOperator.And
});
filters.Add(new Filter()
{
Field = new Field()
{
FieldName = AR303000.GeneralInfoMainAddress.AddressLine1.FieldName,
ObjectName = AR303000.GeneralInfoMainAddress.AddressLine1.ObjectName
},
Condition = FilterCondition.Contain,
Value = "255",
Operator = FilterOperator.And
});
var AR303000Export = context.AR303000Export(cmds.ToArray(), filters.ToArray(), 0, false, false);
return AR303000Export[0][0];
回答1:
The web services can only filter on fields of the primary view of the screen, in this case AR303000.CustomerSummary. If you try to filter on anything else, the system doesn't throw an exception, but instead silently discards the filter.
If you need to be able to filter by this information, I would suggest that you create a generic inquiry that joins on the tables that you need, and use the GI screen through web services as you would with any other inquiry screen.
来源:https://stackoverflow.com/questions/26662651/filtering-on-customer-screen-does-not-use-more-than-one-filter