protected SQLTree.Query GetAttributesJoinedQuery(PXGraph graph, StringBuilder text, List <Type> types, Type fieldWithValue, IBqlWhere _PureWhere)
        {
            Type table0 = BqlCommand.GetItemType(fieldWithValue);
            Type table  = BqlCommand.FindRealTableForType(types, table0);

            SQLTree.SQLExpression exp = null;
            _PureWhere.AppendExpression(ref exp, graph, new BqlCommandInfo(false)
            {
                Tables = types
            }, null);

            return(new SQLTree.JoinedAttrQuery(table.Name, fieldWithValue.Name, "AttributeID", "RefNoteID", exp));
        }