This content has been archived.

Troubleshooting: Obj-List method on numeric data produces unexpected results

Summary

A developer asks:

I created a class that inherits from Data- and that contains the Number property "BuildingLimit".  In an activity, I use the Obj-List method to select a range of values for BuildingLimit. However, instead of the 4 results that I expect, I get over 40 - with many of the returned values being an order of magnitude greater than my selection range. Why am I getting these extra results?

Example

I've created a class that inherits from Data- that contains the property BuildingLimit, which has a Type of Number.

I then create several hundred instances of this class with various values for BuildingLimit.  A portion of this input is:

 
BuildingLimit
80999
81499
81499
81499
81499
81999


In an activity, I use the Obj-List method to select rows where the BuildingLimit is between 81,000 and 81,500:

When I execute this Activity, some of the sample results include:

BuildingLimit
810499
810999
811499
811499
812499

None of these results are between 81,000 and 81,500.

Suggested Approach

In the above example, the BuildingLimit was not exposed as a database column.  Thus, Obj-List performed its selection not on the range of numbers between 81000 and 81500, but rather on strings between 81000 and 81500.

To use non-numeric selection properties in an Obj-List, the properties that you're selecting must be exposed as database columns.  Once this is done, the output of the above example will produce the 4 rows that you expect.

For performance reasons also, properties used for selection in Obj-List should always be exposed columns in the database.

Have a question? Get answers now.

Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.