Loading a collection of data
Layouts generally fetch data automatically, as needed. To load data manually, you can generate the data algorithmically or by some other method. (See also Custom load methods.) If your script will load data manually, use the IsLoaded property on the FilterChanged event handler parameters to prevent the automatic loading of data.
To use the automatic loading of data but adjust the Where clause, set the WhereClause property on the collection. This property is then used instead of the automatically generated Where clause the next time data is loaded. The WhereClause property is a string, so it can accept any code, as long as the code is understood by the data source. The code must be expressed using the correct language syntax for the data source.
You can also generate the WhereClause property automatically from a filter. A filter represents a more restricted set of conditions, essentially a list of ANDed conditions. Since the Where clause is generated automatically, you do not need to know the language syntax of the data source. To automatically generate the WhereClause with syntax appropriate to the data source, use the ApplyFilterAsWhereClause and AddFilterToWhereClause APIs.
To load or manipulate data independent of the user interface, you can use a script to create a temporary collection and then load data. To do this, specify the bound and unbound properties when you create the collection. Then you can use the Load and/or LoadFromMethod APIs to load the data. This example uses the Load API:
Dim col As IPFCollectionI =
context.GetCollection("collectionName",
New String() {"PropA", "PropB"},
New String() {"UnboundPropX", "UnboundPropY"})
Dim result As IPFLoadResultI = col.Load()
If result.LoadCompleted = False Then
...do something with result.Message...
End If
After the data is loaded, it can be used or modified, and modifications can be saved back to the data source, as described below. Any collections that are created in this way are lost as soon as the API completes.