Otis wrote:
Stoop wrote:
Would it be too much to ask for a bit of sample code?
Sorry, I assumed it was selfexplaining, here we go ->
(VB.NET, you use VB.NET iirc)
Dim sorter As ISortExpression = New SortExpression()
sorter.Add(SortClauseFactory.Create(CustomerFieldIndex.CompanyName, SortOperator.Ascending))
sorter.Add(SortClauseFactory.Create(CustomerFieldIndex.ContactName, SortOperator.Ascending))
and now pass the sorter object to a GetMulti() call for example. It will then sort ascending first on CompanyName, then on ContactName.
For typed lists, please take note that you have to refer to the fields in the typed list which can be in different entities, so you have to specify different field indexes, like you also do with filters.
Thats it??? Geez. I thought it was something different. I was trying something along the lines of:
Dim SortExpression As ISortExpression = New SortExpression(SortClauseFactory.Create(CustomerFieldIndex.CompanyName, SortOperator.Ascending))
Dim SortExpression2 As ISortExpression = New SortExpression(SortClauseFactory.Create(CustomerFieldIndex.ContactName, SortOperator.Ascending))
Dim Iclause As ISortClause = New SortClause(PropertyLocationImageObject.ImageOrder, SortOperator.Ascending)
SortExpression.Add(SortExpression2) ...
Which obviously didn't work, but I was thinking that's how one did it based on filtering..
Which brings me to a point: IMHP the help needs to be WAY clearer on things. For example, the VB example in the HELP for sorting (adapter method) is:
Dim sorterInvoices As ISortExpression = New SortExpression( _
SortClauseFactory.Create(InvoicesFieldIndex.ExtendedPrice, SortOperator.Descending))
adapter.FetchTypedView(invoices.GetFieldsInfo(), invoices, bucket, 0, sorter, True)*
- Notice the typo? 'sorter' should be: 'sorterInvoices'!!
Why not make it:
Dim sorterInvoices As ISortExpression = New SortExpression()
Dim Iclause1 As ISortClause = SortClauseFactory.Create(SortClauseFactory.Create(CustomerFieldIndex.CompanyName, SortOperator.Ascending)
sorterInvoices.Add(Iclause1)
adapter.FetchTypedView(invoices.GetFieldsInfo(), invoices, bucket, 0, sorterInvoices, True)
A couple of more lines, but does same thing, and sure is easier to read & digest, especially for new users.
I have virtually no complaints about LLGen - it's a fantastic tool and you, Fran, have always ansered question & provided EXCELLENT support. My one & only complaint is about the HELP. I really think it needs to be redone, or a "QuickStart" section added aimed at new users to get them up and running as quick as possible. I hate posting questions here in forum that probably a lot of people probably consider "Dumb", but I do simply for the fact that I can't figure out to do what I need to do from the help & I simply don't have much time to sit down and work with my project code until I come up with the solution.
Had, what you mentioned above as "obvious", this somewhere in the help, I wouldn't had to post it here. How to sort by 2 fields probably is a common thing to do and at the very least belongs in the "How do I.." section....
Sure, the HELP is beautifully written in terms of being technical. But don't forget about the new guy, Fran. What is obvious to you is not necessarily obvious to everyone else...
Just my opinion & nothing more ..
Thanks for your help!
Steve