Sorting a column that is not an attribute

Sorting a column that is not an attribute

  
I'm trying to sort through a column in a Table Records that is not a real attribute (from the Entities data table), it's a new column in the Table Records (not in any data table)
Does anyone have an idea on how to do it? I've tried numerous not so successfull ways.
Could you tell what ways you tried? That'll help us coming up with an answer :).
Iris -

Retreive the results from the query, then AFTER the query, use the SortRecordList command in the SortRecordList Extension (http://www.outsystems.com/forge/component/22/sortrecordlist/) to do the sorting.

J.Ja
Yes,
I also used shortrecordlist lis many time for attribute not from a entity and it works fine , also we can give multiple column name seprtaed by comma , for sorting.
Yeah, SortRecordList can be fine, but given the "List_SortColumn_GetOrderBy" tag of this post, I figured Íris wants to sort using the RichWidgets sortable columns. That's why I asked what she'd already tried.
Hi Íris,

If you are adding the column directly on the TableRecords and adding a calculated expression on it, you can't sort it unless you resort to some sort of javascript, but that just way too complex and error prone...
If you are using OutSystems Platform 9 you probably can add that column directly on your aggregate as a calculated column. This means that you should be able to sort it just like you sort any other column, in this case instead of using {Entity}.[Attribute] syntax you simply use the name of the column and that should work.

Cheers
André Vieira wrote:
Hi Íris,

If you are adding the column directly on the TableRecords and adding a calculated expression on it, you can't sort it unless you resort to some sort of javascript, but that just way too complex and error prone...
If you are using OutSystems Platform 9 you probably can add that column directly on your aggregate as a calculated column. This means that you should be able to sort it just like you sort any other column, in this case instead of using {Entity}.[Attribute] syntax you simply use the name of the column and that should work.

Cheers
 I've attempted to do it this way and get the error: Invalid column name 'ColumnName'.
Where ColumnName is the name of the calculated field.
 
Hi Braxton,

Can you perhaps share an eSpace that shows what exactly you are doing?

I get the same error as Iris. I cannot share an eSpace but i've included some screen shots.

I have a custom attribute in my regular query and want to use the rich widget List_Sort_Column to sort by the custom attribute. however when i click on the header to sort i get an error "invalid column name 'EventStatus'

thank you for any help.

Here's the 2nd screen shot
Fabian -

That's not going to work like that. It needs a two part identifier. Look at the expression in that column that displays EventStatus to figure out what the two part identifier is.

J.Ja

Hi Justin

Thank you for your reply. In the first screen shot i attached you can see the expression. I don't see how i can get a 2 part identifier. This expression doesn't come from a table. What would the first part be of the 2 part identifier?
Fabian -

Please click on the Expression for EventStatus in the Table to get the 2 part identifier.

See attached screenshot.

J.Ja

Hi J.Ja
I clicked the expression on the table. The Value is set to TblCommEventTable.List.Current.EventStatus. This is a 4 part identifier.
I tried to set the List_SortColumn Column attribute to a few values but none works
"TblCommEventTable.EventStatus"
"{TblCommEventTalbe}.[EventStatus]"
I get an error 'TblCommEventTable' found in 'Order By' parameter is an invalid Entity.
Kind of makes sense.

Any ideas what the proper 2 part identifier should be?
Thank you.

Ok so it ended up being a bug in the version we have 9.0.0.19 that has been fixed in version 9.0.1.9

Fixed dynamic order by to work with calculated attributes (#854718)
Fabian,

The version I am running is 9.0.1.9, and still encounter the Invalid column name error.

Sincerely,
Braxton

ok then it is fixed in 9.0.1.25 . we have that version on our sandbox and there the error doesn't occur.