Filtering on Customer Screen does not use more than one filter

偶尔善良 提交于 2019-12-13 05:15:53

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!