Refetch CurrentRow
 

Refetch CurrentRow

8 posts, 0 answered
  1. Roger Blanchard
    Roger Blanchard avatar
    381 posts
    Registered:
    29 Jun 2018
    26 Jun 2020
    Link to this post
    There is a method in the BusinessEntityAdapter called RefetchCurrentRow. Is there an equivalent in the DatasetModel classes?
  2. Roger Blanchard
    Roger Blanchard avatar
    381 posts
    Registered:
    29 Jun 2018
    29 Jun 2020 in reply to Roger Blanchard
    Link to this post
    Any comments from CW?

    What I am trying to replace is a query where we are reading x number of records using NO-LOCK. We then do some processing based on each record and then come back and updated the original using GET-CURRENT. It is possible the record is updated by another user while we are processing and do not want to right over.
  3. Daniel van Doorn
    Daniel van Doorn avatar
    17 posts
    Registered:
    18 Jun 2018
    29 Jun 2020 in reply to Roger Blanchard
    Link to this post
    Hi Roger,

    I would suggest just executing the fill() method without any additional parameters. This should just re-run the query with the current filter settings.

    BR Daniel


  4. Roger Blanchard
    Roger Blanchard avatar
    381 posts
    Registered:
    29 Jun 2018
    29 Jun 2020 in reply to Daniel van Doorn
    Link to this post
    Hey Daniel,

    Are you saying executing FILL in our DO WHILE oEcommSnapshot:EcommSnapshot:Available LOOP?

    DO WHILE oEcommSnapshot:EcommSnapshot:Available:

        // sending record to REST endpoint

        // if we were able to send to REST endpoint update record but it may have already been updated
        oEcommSnapshot:TrackingChanges     = TRUE.
        oEcommSnapshot:EcommSnapshot:IsSynchronized = TRUE.
        oEcommSnapshot:EcommSnapshot:LastSynced  = NOW.
        oEcommSnapshot:SaveChanges().

        oEcommSnapshot:EcommSnapshot:GetNext().

    END.
  5. Mike Fechner
    Mike Fechner avatar
    319 posts
    Registered:
    14 Sep 2016
    29 Jun 2020 in reply to Roger Blanchard
    Link to this post
    I don't think there's a method for that use case.

    Probably the easiest would be to use two dataset model instances. One for navigating the query and the other one to fetch the current values and update the record.
  6. Roger Blanchard
    Roger Blanchard avatar
    381 posts
    Registered:
    29 Jun 2018
    29 Jun 2020 in reply to Mike Fechner
    Link to this post
    That is what I figured....thanks!!
  7. Mike Fechner
    Mike Fechner avatar
    319 posts
    Registered:
    14 Sep 2016
    29 Jun 2020 in reply to Roger Blanchard
    Link to this post
    Well ... you know where to find our JIRA ...
  8. Roger Blanchard
    Roger Blanchard avatar
    381 posts
    Registered:
    29 Jun 2018
    29 Jun 2020 in reply to Mike Fechner
    Link to this post
    I sure do 
8 posts, 0 answered