REST Api >> Able to sort by index
Liina Saar
2021-01-22
Operating system: macOS
There is an update note >>>

"From Dev 8.5 2020 12 21 b316 ->

Bug fixed/feature added:
REST API >> Cannot sort by Index that is not the sames as a field name

Added "keyname=ActCodeForSale"


If you specify sortfield it works as before

If you specify keyname and sortfield it will use the key "keyname" and apply any "range" argument to "sortfield"
if you specify only keyname then "range" should not be specified and is not available

What worked before:
http://hostname.domain.top/api/1/INVc?sort=Group


What is now added (example)


curl --user SJ:Sample99 -X GET 'http://localhost:5557/api/1/INVc?sortfield=ActCodeForSale&&fields=Code,Name'
you have the example as txt for the above from and the original.

original.txt -> how it looked before
test.txt -> how it looks like with sorting (simplified)"

Is there more specific manual or other documentation about this?
How is working sortfield and what is ActCodeForSale?
Bror-Erik Kotiranta
2021-01-29
Hello Liina,

only documentation that i know exists (written down) are

https://partners.hansaworld.com/restapi-docs

http://www.hansamanuals.com/main/mailnumber___61173/theconf___1145/shortcode___HW0801TECH_REST_API/hwconvindex.htm

https://hansaworld-web.s3.amazonaws.com/university/university/Webinars/2018/HW%20web%20api%20and%20Oauth2%20with%20standard-id.mp4

https://hansaworld-web.s3.amazonaws.com/university/university/Webinars/2017/Rest%20API.mp4

Br, Bror-Erik

Kristaps Žogots
2021-01-29
I think there is one confusing part:

At first it's written:
Added "keyname=ActCodeForSale"
---------
Then later in the example you use "sortfield":
http://localhost:5557/api/1/INVc?sortfield=ActCodeForSale&&fields=Code,Name

Should we use "keyname" or "sortfield"
Bror-Erik Kotiranta
2021-02-02
Hello,

seems like i´ve overlooked something. Need to review the update note. But i think it is

curl --user SJ:Sample99 -X GET 'http://localhost:5557/api/1/INVc?keyame=ActCodeForSale&&fields=Code,Name'

Please come back to me and i will update the update note
Br, Bror-Erik
Kristaps Žogots
2021-02-05
Does this support AppendFieldToKeyName (and maybe AppendListFieldToKeyName or AppendMatrixFieldToKeyName) with "range" parameter as well?
Let's say you have an index:
KeySegment(LangCode);
SubsetKeyBegin2(LangCode);
AppendFieldToKeyName(TutorialCode);
KeySegment(LangCode);
KeySegment(Heading);


Can I use range to specify TutorialCode or only LangCode?
Bror-Erik Kotiranta
2021-05-17
I´m afraid you need to ask erik for this one
Leave Comment
You can subscribe to notifications for this post by selecting the 'star' icon on the top right corner of the post.
Back to the list
Latest Posts
Piotr Wycichowski
Hi, I checked option "Use External Mail Software" in setting "Mail and Conferences Settings" in module "Mail and Conferences". When I create an invoice email I have a ...
17:38 8 Aug 2025
Piotr Wycichowski
Hi, Is somebody experienced in necessary settings for successful connection to server using webclient. When I tried, I got warning in brower, that Web client settings for HTTPS is not setup. So I ...
12:59 21 July 2025