NetTalk Central

NetTalk Web Server => Web Server - Ask For Help => Topic started by: Thys on April 04, 2018, 11:15:59 PM

Title: NetWebService - limiting numer of records in response
Post by: Thys 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
Title: Re: NetWebService - limiting numer of records in response
Post by: Bruce 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

Title: Re: NetWebService - limiting numer of records in response
Post by: Thys on April 12, 2018, 12:52:48 AM
Thanks