NetTalk Central

Author Topic: NetWebServiceMethod - problems withsort order in json.append(view)  (Read 4561 times)

Thys

  • Sr. Member
  • ****
  • Posts: 311
    • View Profile
    • Incasu
    • Email
Hi,

I have a view in the response of a call. On the template screen I set the sort order of the view to the NAME column of the table. But when the append statement is called to populate JSON like here:

jsonResults.append(MedicalAidView,'MedicalAid')

the sort order of NAME is ignored and the response is sorted by the primary key column. Is there a way to fix this please?

Thys

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11251
    • View Profile
Re: NetWebServiceMethod - problems withsort order in json.append(view)
« Reply #1 on: March 18, 2019, 12:22:40 AM »
Hi Thys,

In my example here I set the order to xxx, then looked at the generated code to see where that is used.
There are a number of lines like;

CustomerView{prop:order} = xxx

Notice that the xxx is an expression, so if for example I'd use CUS:Name, I would have needed to set it as
'Cus:Name'
with the quotes.

Check yours to see if you see the prop:order set, if not I guess I'll need some sort of example.

cheers
Bruce