BE:FetchRelatedRecords
 

BE:FetchRelatedRecords

2 posts, 0 answered
  1. Roger Blanchard
    Roger Blanchard avatar
    413 posts
    Registered:
    29 Jun 2018
    26 Feb 2019
    Link to this post
    We are using the FetchRelatedRecord in our BE with the code below. It works fine when a record was created or updated. However, If a record was deleted it does not fall into the FOR EACH eTagItem loop. I tried adding a FOR EACH eTagItemBefore and while the record is found the call to FetchRelatedrecords fails. Should this method work for a before buffer? 

    FOR EACH eTagItem WHERE ROW-STATE (eTagItem) <> ROW-UNMODIFIED ON ERROR UNDO, THROW:
             
             THIS-OBJECT:FetchRelatedRecords (BUFFER eTagItem:HANDLE, "eTagHdr").
             
             IF NOT AVAILABLE eTagHdr THEN // we need our parant record to continue validation
        DatasetHelper:AddErrorString (BUFFER eTagItem:HANDLE, SUBSTITUTE ("TagHdr record not found with BatchId=&1", etagItem.BatchId), "BatchId", "eTagItem") .    
          
      END.   

    FOR EACH eTagItemBefore WHERE ROW-STATE (eTagItemBefore) EQ ROW-DELETED ON ERROR UNDO, THROW:
        
        THIS-OBJECT:FetchRelatedRecords (BUFFER eTagItemBefore:HANDLE, "eTagHdr").
        
       END.
  2. Mike Fechner
    Mike Fechner avatar
    342 posts
    Registered:
    14 Sep 2016
    26 Feb 2019 in reply to Roger Blanchard
    Link to this post
    I don't think so. 
2 posts, 0 answered