to get a personalized navigation.
to get a personalized navigation.
Hello,
We would like to be able to order the results by a certain field for endpoints /customer, /supplier and /contact. The orderBy query parameter, when it exists, doesn't seem to have any effect on the order of the returned items.
This would help solving the issue we currently have. Our scenario (using contact as an example, same scenario for other entities): we need to fetch all the contacts that were modified after a certain date and process them. During the process, we might update the contacts.
We actually fetch the contacts and process them page by page, with a page size of 25. In other words: fetch 25 contacts, update them, fetch next 25 contacts, update them and so on.
The problem is that when using the lastModifiedDateTime query parameter, the results are automatically ordered by the lastModifiedDateTime field. Since we update the 25 first contacts after we fetched them, their lastModifiedDateTime changes and these contacts are no longer the 25 first contacts. When fetching the second page of 25 contacts, the order has changed and we miss some contacts and process other contacts twice.
If we could order the contacts by another field then the order would not change and we would be able to process all the contacts.
Our workaround is to fetch all the contacts before processing them, but it means that all the contacts are loaded in memory, which is not ideal.
Do you have any plan to implement the orderby query parameter for these endpoints?
Thank you
Solved! Go to Solution.
Hello,
Currently, OrderBy query parameter is obsolete and it's omitted by the endpoints. Every transaction is automatically ordered by ASC based on its PK while being fetched from the DB (base GET invoke),therefore, it shouldn't be used in the URI. This parameter will be removed from the API documentation soon.
If you could register this request at Ideas section, this will be evaluated by the development team.
Thanks.
Actually it would be perfect for our scenario if the results were always ordered by the PK, unfortunately it's not the case when using the lastModifiedDateTime query parameter. With this parameter, the results are ordered by lastModifiedDateTime.
Is this a bug then?
Hello Véronique,
We'll check this over to make sure whether it's working as designed. (LastModifiedDate & Default Sort-Ordering)
We confirm that this is currently following the intended behaviour, results are ordered by LastModifiedDateTime when LMDT is used as filtering parameter. In base GET calls, records are orderedBy "internalId".
Copyright © 2022 Visma.com. All rights reserved.