I wonder if it's possible to display a listview and further filtering the collection?
In the scenario below, I would like only display the objects in the listview based on certain comments.
----- MetaPropertyPage -----
VersionMap = Map(~RavFM0qQ4v30[Duplicate])
ListParam = Parameter(Plugin<~M58CMWdMNbVR[DBS - Versioned Organizational Process ListView]>,NoDefaultColumn,ReOrder,ToolBar[-CLDU])
History = Item(~RavFM0qQ4v30[Duplicate]),Contains(VersionMap),Control(ListView),Title(No),Param(@ListParam)
------ MACRO ------
Function GetStandardCollectioin(mgobjObject as MegaObject, vntSelectorID as Variant, InitString as String) as MegaCollection
GetStandardCollectioin = mgobjObject.GetRoot.getSelection("Select [Organizational Process] Where [Comment] Like '[Version Comment]#' ")
Yes you can filter the results coming out of a list via queries, but I notice than in your example you use a Getselection in a macro. Too bad that youaren't benefitting from the better performance of being in a macro situation. ERQL selects are to be avoided whenever possible. Sometimes people create queries written by VB script code but then put queries in that code (which defeats the point, a bit)
Recently we even had a situation where it was necessary to deliver the list result already sorted. This can be done when the list relies on a query written by macro, on which you can act on the "order" attribute of the query results.
@lrobinet how would you improve this case? A macro was used but with a getselection, I don't understand your statement about using macro's instead of ERQL, in these macro's you need to write a query sometime to fetch the data you actually need.
In a query implemented via macro, the idea is to avoid putting a GetSelection with another query.
You can use GetCollection, then recuperate information from each object via GetProp and/or other GetCollections in imbedded loops, using if statements, in order to do the equivalent of a query.
Obviously, this is most beneficial if you pay attention to the order in which you limit the collection of items, which means treating in the conditions of the first loops what allows you most reduce the number of treated objects.
that was the only possible thing I could think of that would fit the needs to achieve the goal. This means for example that if you have 20.000 application objects that a getcollection on repository level and looping through that collection would be faster than actually writing a more specific query?
This is important information since that can help many of us to actually improve performance.
I'm aware of using MegaFields to improve performance (one of your older posts remarks/from claudio, which we make use of), but I'm surprised of the fact that the getcollection will increase our performance. Time to have some tests on that 🙂