REST
 

REST

4 posts, 0 answered
  1. Roger Blanchard
    Roger Blanchard avatar
    381 posts
    Registered:
    29 Jun 2018
    21 Apr 2023
    Link to this post
    We are using PASOE web handlers with annotations in the BE (shown below) to allow access to our data from an ecommerce site. 

    @RestAddress (type="collection", address="/LoyaltyHistory/~{CustomerNum}", tables="eLoyaltyHistory", id="CustomerNum",
                  fields="eLoyaltyHistory.*", canRead="true", canUpdate="false", canDelete="false", canCreate="false"
                  ).

    If the web developer does not implement batching (limit=100 with the offset) it is possible that they can cause some performance problems. Is there any way to determine if the limit parameter was sent and change if necessary, before the PDS is filled? 
  2. Peter Judge
    Peter Judge avatar
    8 posts
    Registered:
    11 Aug 2022
    21 Apr 2023 in reply to Roger Blanchard
    Link to this post
    If the limit query parameter is not sent, a default value of 20 records is used (set by the RestEntitiesWebHandler).

    The FetchDataRequest object that's passed in to FetchData has that value (whether specified or default) in the NumRecords property, so you can see what that is. That value can also be updated if needed, in individual BusinessEntities. I do not think there's a general event/hook where you can inspect the FetchDataRequest before it's used to retrieve data.

    -- peter
  3. Mike Fechner
    Mike Fechner avatar
    319 posts
    Registered:
    14 Sep 2016
    21 Apr 2023 in reply to Roger Blanchard
    Link to this post
    You're using the RESTful access to the Business Entities using the RestEntitiesWebHandler and the /web/Entities/ endpoint? 

    The hardcodedly falls back to NumRecords = 20 when the limit is not provided:

            IF poWebRequest:URI:HasQueryName("limit":U) THEN
                ASSIGN oRequest:NumRecords = DataTypeHelper:ToInteger(poWebRequest:URI:GetQueryValue("limit":U)).
            ELSE
                ASSIGN oRequest:NumRecords = 20 .




  4. Roger Blanchard
    Roger Blanchard avatar
    381 posts
    Registered:
    29 Jun 2018
    21 Apr 2023 in reply to Mike Fechner
    Link to this post
    >> You're using the RESTful access to the Business Entities using the RestEntitiesWebHandler and the /web/Entities/ endpoint? 

    Yes.

    >> If the limit query parameter is not sent, a default value of 20 records is used (set by the RestEntitiesWebHandler).
    >> The hardcodedly falls back to NumRecords = 20 when the limit is not provided:

    That will help. 

    @Peter and @Mike thanks for the info.
4 posts, 0 answered