4 Replies Latest reply on Jul 2, 2012 7:50 PM by rounakjain

    bug with filtervalues

    rounakjain

      Title

      bug with filtervalues

      Post

      If (IsEmpty ( FilterValues ( List ( GI Fitting Price List::PL ItemName);Product Name ));

      Product Name & " " & Product Size;

      Product Name & " " &  Substitute ( Product Size; ["20";"3/4"];["15";"1/2"]))

       

      Example:

      GI Fitting Price List table has two fields: "PL ItemName" & "PL ItemSize"

      "PL ItemName" contains "Elbow"

      "PL ItemSize" contains "15"

      The fields Product Name and Product Size are from table "Invoice".

      When I enter "Elbow" in Product Name and "15" in Product Size I get Elbow 1/2 (as expected) with the above IF statement.

      However, when I enter "Elbow" in Product Name and "20x15" in Product Size I get Elbow 20 x 15 instead of the expected Elbow 3/4 x 1/2

      Then I added a new entry in the GI Fitting Price List table with "PL ItemName" = "Elbow" and "PL ItemSize" = "20 x 15". Then I got the correct result.

      I don't understand what does the above if statement has to do with "PL ItemSize". It seems like a bug.

        • 1. Re: bug with filtervalues
          philmodjunk

          I doubt that it's a bug and I doubt that the data in PL ItemSize has anything to do with it.

          The key phrase here would seem to be "Then I added a new entry..."

          I'd need to see the relationships between your two tables (this all looks familiar but I don't trust my memory to be correct here), how you have designed your layout and a more detailed description of what you are doing when you input this data and don't get the results you need.

          Best guess is that there is no related record returned by List ( GI Fitting Price List::PL ItemName) that returns "Elbow"--which could mean a problem with the relationship, data entry or maybe a record just needs to be committed.

          • 2. Re: bug with filtervalues
            rounakjain

            During data entry i write 20 instead of 3/4, 32 instead of 1 1/4 and so on because its easier to type. However, during print I need 3/4, 1 1/4 and so on. Hence the above substitution code.

            Relationships:

            GI Fitting Price List:PL ItemName::Line Table:Product Name

            and

            GI Fitting Price List:PL ItemSize::Line Table:Product Size

            If it is not a bug, I don't think anything other than relationship could be the source of problem. You may be right in saying ....."Best guess is that there is no related record returned by List ( GI Fitting Price List::PL ItemName) that returns "Elbow"--which could mean a problem with the relationship,".

            Since, I need to get the prices from the price list, I cannot alter the above relationship.

             

            • 3. Re: bug with filtervalues
              philmodjunk

              So this describes one relatioship that matches on both pairs of fields:

              GI Fitting Price List::PL ItemName=Line Table::Product Name AND
              GI Fitting Price List::PL ItemSize=Line Table::Product Size

              This is where the value in PL ItemSize makes a difference.

              List ( GI Fitting Price List::PL ItemName)

              will be empty unless both the ItemName AND the ItemSize of the current record in LineTable exactly match in both fields to a record in GI Fitting Price List.

              • 4. Re: bug with filtervalues
                rounakjain

                thanks for identifying the source of the problem. I fixed it by creating a new relationship:

                GI Fitting Price List 2::PL ItemName=Line Table::Product Name