2016-08-10
1.1.0
António Chinita
9.1.501.0
All
.NET
[Overview]
Allows you to filter a RecordList Object by attribute(s) name.
[Detail]
This component allows you to filter RecordList objects, on the specfied columns by the specified value.
It also supports operators to enable a little more complexity on the searches.
Text Types support: <>
Int&Datetime Types support: <, <=, >, >= and <>
Examples on how to use these are provided in the method's description.
-----------------------------------------------------------------------------------
Inputs
-----------------------------------------------------------------------------------
RecordList (Object): The RecordList Object to filter from. Use the Built-In ToObject() function to convert your RecordList.
Attribute (String): The column name to filter from. This is the structure attribute name you wish to filter by. Multiple attribute names are supported, just separate them with commas. Eg. Name, Description, Comment
FieldValue (String): The search value. Supports operators.
-----------------------------------------------------------------------------------
Operator Specifications
-----------------------------------------------------------------------------------
Default Behavior (simple string value)
Verifies if this value is contained inside the attribute value.
Equivalent to SQL's LIKE operator.
With Operators
Supported Operators
String: <> (Equivalent to SQL's NOT LIKE)
DateTime, Int: <, <=, >, >=, <>
Example, just prepend the operator, and a space before the filter value.
Eg.
Filter value "<= 1987-01-18" will show all dates previous to Jan. 18th 1987.
-----------------------------------------------------------------------------------
Implementation Sugestions
-----------------------------------------------------------------------------------
If you need to use this, you probably have a larger list that contains all the existing data. So you shouldn't need to call the method returning all that data ever again.
Always have in mind that the method provided by the extension will operate directly on the provided Object (reference).
On a typical scenario you should have something like:
A base recordlist that is never modified.
A RecordList variable of the same type that will be populated by a ListDuplicate() action. This will avoid ever touching the original dataset
A filter action on the Local variable that is a duplicate of the original dataset.
Eg.
-----------------------------------------------------------------------------------
Final Thoughts
-----------------------------------------------------------------------------------
The functionality provided by this extension will enable you to filter Structure RecordLists, that almost always require custom logic to do so. Eg. Recordlists returned by WebServices without search input parameters.
NOTICE:
Searching these lists, requires iterating through all its records, as a result, performance suffers on long lists.
Do not use such components lightly, this should be used only when no other options are avaliable and you know the lists aren't very long.
In my case, I had to develop this because our application is running heavily on structures returned by legacy 4GL Java WebServices that can't be easily changed to accomodate search parameters.
Notice: This component takes advantage of private and undocumented Platform APIs, which can change without notice. As a result, this component may unexpectedly break as the Platform is upgraded. We advise proper testing to ensure that your applications continue to work as expected when upgrading/patching the Platform.