NetTalk Central

Author Topic: Sorting a Browse by calculated field  (Read 2721 times)

ianburgess

  • Full Member
  • ***
  • Posts: 119
    • View Profile
    • Email
Sorting a Browse by calculated field
« on: June 24, 2012, 05:24:02 AM »
I have a web browse which has a calculated field, using a local variable. The code to set the local variable is embedded Inside Browse Loop>1.Validate Record.

All works fine and the browse correctly displayes the local variable, EXCEPT that if one tries to sort by the contents of the local variable column by clicking the column heading, no records are displayed.

Can anyone suggest how to resolve this?

Many thanks.

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Sorting a Browse by calculated field
« Reply #1 on: June 24, 2012, 11:40:25 PM »
Hi Ian,

you can't sort by a calculated field - at least not directly.
The sort header translates into a prop:order statement for the View.
It's likely you would need to either hand-craft the prop:order (using the raw database fields) or turn off sorting on that column.

Cheers
Bruce