NetTalk Central

Author Topic: NetWebService - limiting numer of records in response  (Read 4335 times)

Thys

  • Sr. Member
  • ****
  • Posts: 311
    • View Profile
    • Incasu
    • Email
NetWebService - limiting numer of records in response
« on: April 04, 2018, 11:15:59 PM »
Hi,

I want to limit the number of records returned by a web service method. There is normally a VIEW that is used to return records in the .APPEND method, but I can't find a way in Clarion to limit the number of records returned, and the .APPEND method doesn't offer options to limit the number of records returned.

Is there an existing way to limit the number of records in a VIEW (something like SELECT TOP 10 * ...) or by the NetWebService template?

Thys

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11251
    • View Profile
Re: NetWebService - limiting numer of records in response
« Reply #1 on: April 09, 2018, 10:39:59 PM »
there are 2 parts to your question;

a) can you limit the number of records fetched from the server via the VIEW and
b) can you limit the number of records in the jFiles "Append" statement.

Regarding a) - there's no generic Clarion way to do it - although I guess it's possible with the appropriate prop:sql command.

Regarding b there's a property in jFiles;
SaveRecords
which can limit the number added to the json. For example;

  json.start()
  json.SaveRecords = 100
  json.append ...


This will limit the json output to 100 records.

Cheers
Bruce


Thys

  • Sr. Member
  • ****
  • Posts: 311
    • View Profile
    • Incasu
    • Email
Re: NetWebService - limiting numer of records in response
« Reply #2 on: April 12, 2018, 12:52:48 AM »
Thanks