REST PUT with joined table
 
Forums / SmartComponent Library - Developer Forum / REST PUT with joined table

REST PUT with joined table

10 posts, 1 answered
  1. Roger Blanchard
    Roger Blanchard avatar
    413 posts
    Registered:
    29 Jun 2018
    07 May 2021
    Link to this post



    We are working on our REST API and have a business entity with a joined table. Our primary table is PhysicalInv with the joined table PhyLine.

    According to swagger the PUT would be /PhysicalInv/{RunNum}/PhyLine/{LineNum}

    The sample json from swagger is

    {"_id": "string","_errorString": "string","RunNum": 0,"LineNum": 0,"ItemNum": "string","PackNum": 0,"RunDate": "string","Stat": 0,"Qty1": 0,"Qty2": 0,"Qty3": 0,"Qty4": 0,"Qty5": 0,"UpdDate": "string","Counter1": "string","Counter2": "string","Counter3": "string","Counter4": "string","UpcNum": "string","Counted": false,"Item_Descrpt": "string","AddToCounts": false,"VarianceCnt": 0,"VarianceCost": 0,"VarianceRetail": 0,"id": "string"}

    When I try to PUT the following

    {
      "RunNum": 65002,
      "LineNum": 1,
      "ItemNum": "           1",
      "PackNum": 1,
      "Qty1": 6,
      "Qty2": 0,
      "Qty3": 0,
      "Qty4": 0,
      "Qty5": 0,
      "id": "1"
    }

    I will get the error below. The funny thing is if I look at the PASOE logs it looks to me the query is correct. What am I missing? 

    "title": "An application error has occurred (Consultingwerk.Exceptions.DatasetException)", "error": "Consultingwerk.Exceptions.DatasetException", "message": "PhysicalInv record not found with RunNum=65002\u0004RunNum\u0004ePhyLine",


  2. Roger Blanchard
    Roger Blanchard avatar
    413 posts
    Registered:
    29 Jun 2018
    07 May 2021 in reply to Roger Blanchard
    Link to this post
    The PASOE logs show this for the request.

    [21/05/07@08:18:00.439-0400] P-008840 T-002332 1 AS-8 SmartWebHa     ##############################################################################################################################
    [21/05/07@08:18:00.439-0400] P-008840 T-002332 1 AS-8 SmartWebHa     ### Begin Web Handler Request: PUT /Entities/PhysicalInv/65002/PhyLine/1
    [21/05/07@08:18:00.439-0400] P-008840 T-002332 1 AS-8 SmartWebHa     ##############################################################################################################################
    [21/05/07@08:18:00.441-0400] P-008840 T-002332 1 AS-8 DataAccess     Client-Query: for each ePhyLine where ePhyLine.RunNum = "65002" and ePhyLine.LineNum = "1"
    [21/05/07@08:18:00.441-0400] P-008840 T-002332 1 AS-8 DataAccess     Default-Query: FOR EACH PhyLine, FIRST Item OF PhyLine INDEXED-REPOSITION
    [21/05/07@08:18:00.443-0400] P-008840 T-002332 1 AS-8 DataAccess     Prepare-Query: FOR EACH PhyLine WHERE PhyLine.RunNum = "65002" and PhyLine.LineNum = "1", FIRST Item OF PhyLine INDEXED-REPOSITION
    [21/05/07@08:18:00.443-0400] P-008840 T-002332 1 AS-8 DataAccess     Index Information on Buffer PhyLine: upRun
    [21/05/07@08:18:00.443-0400] P-008840 T-002332 1 AS-8 DataAccess     Index Information on Buffer Item: upItem
    [21/05/07@08:18:00.443-0400] P-008840 T-002332 1 AS-8 DataAccess     Restart-Rowid for Table ePhyLine: ?
    [21/05/07@08:18:00.443-0400] P-008840 T-002332 1 AS-8 DataAccess     Next-Rowid for Table ePhyLine: ?
    [21/05/07@08:18:00.443-0400] P-008840 T-002332 1 AS-8 DataAccess     Last-Batch for Table ePhyLine: yes
    [21/05/07@08:18:00.443-0400] P-008840 T-002332 1 AS-8 ORS_DBG        <Osprey.Pos.PhysicalInv.PhysicalInvBusinessEntity  ValidateData>:  Begin
    [21/05/07@08:18:00.447-0400] P-008840 T-002332 1 AS-8 DataAccess     Client-Query: for each ePhysicalInv WHERE ePhysicalInv.RunNum = "65002"
    [21/05/07@08:18:00.447-0400] P-008840 T-002332 1 AS-8 DataAccess     Default-Query: FOR EACH PhysicalInv, FIRST CodeDef WHERE CodeDef.Type = 'phy status' AND CodeDef.IdNum = PhysicalInv.Stat OUTER-JOIN INDEXED-REPOSITION
    [21/05/07@08:18:00.447-0400] P-008840 T-002332 1 AS-8 DataAccess     Prepare-Query: FOR EACH PhysicalInv WHERE PhysicalInv.RunNum = "65002", FIRST CodeDef WHERE CodeDef.Type = 'phy status' AND CodeDef.IdNum = PhysicalInv.Stat OUTER-JOIN INDEXED-REPOSITION
    [21/05/07@08:18:00.447-0400] P-008840 T-002332 1 AS-8 DataAccess     Index Information on Buffer PhysicalInv: upRunNum
    [21/05/07@08:18:00.447-0400] P-008840 T-002332 1 AS-8 DataAccess     Index Information on Buffer CodeDef: upIdNum
    [21/05/07@08:18:00.447-0400] P-008840 T-002332 1 AS-8 DataAccess     Restart-Rowid for Table ePhysicalInv: ?
    [21/05/07@08:18:00.447-0400] P-008840 T-002332 1 AS-8 DataAccess     Next-Rowid for Table ePhysicalInv: ?
    [21/05/07@08:18:00.447-0400] P-008840 T-002332 1 AS-8 DataAccess     Last-Batch for Table ePhysicalInv: yes

  3. Roger Blanchard
    Roger Blanchard avatar
    413 posts
    Registered:
    29 Jun 2018
    07 May 2021 in reply to Roger Blanchard
    Link to this post
    The GET for that record works just fine. The response in swagger is below

    {
      "id": 1,
      "url": "http://192.168.168.21:8940/web/Entities/PhysicalInv/65002/PhyLine/1",
      "RunNum": 65002,
      "LineNum": 1,
      "ItemNum": "           1",
      "PackNum": 1,
      "RunDate": null,
      "Stat": 1,
      "Qty1": 5,
      "Qty2": 0,
      "Qty3": 0,
      "Qty4": 0,
      "Qty5": 0,
      "UpdDate": null,
      "Counter1": "",
      "Counter2": "",
      "Counter3": "",
      "Counter4": "",
      "UpcNum": "",
      "Counted": true,
      "Item_Descrpt": "Membership Fees123456",
      "AddToCounts": false,
      "VarianceCnt": 0,
      "VarianceCost": 0,
      "VarianceRetail": 0
    }
  4. Roger Blanchard
    Roger Blanchard avatar
    413 posts
    Registered:
    29 Jun 2018
    07 May 2021 in reply to Roger Blanchard
    Link to this post
    Would the annotation below be correct for the PUT?

    @RestAddress (type="record", address="/PhysicalInv/~{RunNum}/PhyLine/~{LineNum}", tables="ePhyLine", id="LineNum",fields="ePhyLine.*", canRead="true", canUpdate="true", canDelete="false").
  5. Roger Blanchard
    Roger Blanchard avatar
    413 posts
    Registered:
    29 Jun 2018
    07 May 2021 in reply to Roger Blanchard
    Link to this post
    We tracked our issues down to the FetchRelatedRecords METHOD.

    If we remove that code the REST PUT works just fine.

    This code works with the GUI front end as well as if we use the DatasetModel class.

    Should this work when updating via REST?

    /*------------------------------------------------------------------------------
            Purpose: Provides a hook for high level data validation before Update 
                     operations                                                                     
            Notes:   Invoked during SaveChanges (). When the ERROR flag of the ProDataset
                     is set, the Update operation will be cancelled before writing back
                     the data to the database using the DataAccess object                                                                      
        ------------------------------------------------------------------------------*/
        METHOD OVERRIDE PUBLIC VOID ValidateData ():
              
           
            
            FOR EACH ePhyLine WHERE ROW-STATE (ePhyLine) <> ROW-UNMODIFIED ON ERROR UNDO, THROW:
           
            /* Roger Blanchard / Osprey Retail Systems Jan 14, 2019
    Let's fetch our ePhysicalInv record as we will want
    to update some field based on the type of CRUD operation  
    */
             
            THIS-OBJECT:FetchRelatedRecords (BUFFER ePhyLine:HANDLE, "ePhysicalInv").
           
           IF NOT AVAILABLE ePhysicalInv THEN // we need our parent record to continue validation
    DatasetHelper:AddErrorString (BUFFER ePhyLine:HANDLE, SUBSTITUTE ("PhysicalInv record not found with RunNum=&1", ePhyLine.RunNum), "RunNum", "ePhyLine") .
           
            END.  
            
           
            
        END METHOD.
  6. Mike Fechner
    Mike Fechner avatar
    342 posts
    Registered:
    14 Sep 2016
    10 May 2021 in reply to Roger Blanchard
    Link to this post
    Hi Roger,

    I have just tried this out in my sports2000 environment. 

    DEFINE {&ACCESS} DATASET dsOrder{&SUFFIX} {&REFERENCE-ONLY} FOR eOrder{&SUFFIX}, eCustomer{&SUFFIX}, eOrderLine{&SUFFIX}, eItem{&SUFFIX}, eSalesrep{&SUFFIX} 
        DATA-RELATION eOrdereCustomerRelation FOR eOrder{&SUFFIX}, eCustomer{&SUFFIX} 
            RELATION-FIELDS (CustNum,CustNum)
        DATA-RELATION eOrdereOrderLineRelation FOR eOrder{&SUFFIX}, eOrderLine{&SUFFIX} 
            RELATION-FIELDS (Ordernum,Ordernum)
        DATA-RELATION eOrdereSalesrepRelation FOR eOrder{&SUFFIX}, eSalesrep{&SUFFIX} 
            RELATION-FIELDS (SalesRep,SalesRep)
        DATA-RELATION eOrderLineeItemRelation FOR eOrderLine{&SUFFIX}, eItem{&SUFFIX} 
            RELATION-FIELDS (Itemnum,Itemnum)

    and 

    @RestAddress (type="record", address="/Customers/~{CustNum}/Orders/~{OrderNum}/OrderLines/~{LineNum}", tables="eOrderLine,eItem", id="LineNum",
                  fields="*", canRead="true", canUpdate="true", canDelete="true").

    Using the SwaggerEntities interface I can GET https://sfrbo.consultingwerkcloud.com:8821/web/Entities/Customers/50010/Orders/175035/OrderLines/2

    and PUT https://sfrbo.consultingwerkcloud.com:8821/web/Entities/Customers/50010/Orders/175035/OrderLines/2

    with this payload:

    {
      "Ordernum": 175035,
      "Linenum": 2,
      "Itemnum": 54,
      "Price": 4.86,
      "Qty": 13,
      "Discount": 20,
      "ExtendedPrice": 46.66,
      "OrderLineStatus": "Ordered"
    }

    This successfully updates the Order line for me. 

    I don't see why FetchRelatedRecords would not work in RESTful. Can you please write the contents of the ePhyLine record within the FOR EACH to the AppServer's logfile:

    Consultingwerk.Util.LogManager:WriteBuffer (BUFFER ePhyLine:HANDLE, FALSE) .

    Also, is there any stack trace with the error message from the initial post? 
  7. Roger Blanchard
    Roger Blanchard avatar
    413 posts
    Registered:
    29 Jun 2018
    10 May 2021 in reply to Mike Fechner
    Link to this post
    Hello Mike,

    I hope you are doing well.

    There was no stack trace. However, we are not sure the server we were testing against had to correct annotations. We rebuilt our .r code and .annotations and that helped get us to the point we are now.

    I will add the WriteBuffer as to log the TT to the log file.

    If I add a FIND after the FetchRelatedRecords then the ePhysicalInv is available.

       FOR EACH ePhyLine WHERE ROW-STATE (ePhyLine) <> ROW-UNMODIFIED ON ERROR UNDO, THROW:
           
                    
           
            THIS-OBJECT:FetchRelatedRecords (BUFFER ePhyLine:HANDLE, "ePhysicalInv").

     

            FIND ePhysicalInv WHERE ePhysicalInv.RunNum EQ ePhyLine.RunNum NO-ERROR. 

    END.
  8. Roger Blanchard
    Roger Blanchard avatar
    413 posts
    Registered:
    29 Jun 2018
    10 May 2021 in reply to Mike Fechner
    Link to this post
    Here is the info from the PASOE log. If I remove the FIND after the FetchRelatedRecords then the ePhysicalInv record is not available.

    [21/05/10@07:34:59.381-0400] P-006320 T-010268 4 AS-10 AS -- TRACE: Open4GLWriteLast 1730. (8401)
    [21/05/10@07:34:59.381-0400] P-006320 T-010268 4 AS-10 AS -- TRACE: Open4GLWrite 1730. (8402)
    [21/05/10@07:34:59.382-0400] P-006320 T-010268 4 AS-10 AS -- TRACE: cso4GL: Before loadProc() (8458)
    [21/05/10@07:34:59.382-0400] P-006320 T-010268 4 AS-10 AS -- TRACE: STATELESS: locating proxy-id 214e7ec6 (Progress.Web.InternalWebHandler:HandleRequest) for operation 16 (8458)
    [21/05/10@07:34:59.382-0400] P-006320 T-010268 3 AS-10 AS -- TRACE: SINGLETON Non-Void Method 'Progress.Web.InternalWebHandler:HandleRequest' START (Proxy 558792390).
    [21/05/10@07:34:59.382-0400] P-006320 T-010268 4 AS-10 AS -- TRACE: STATELESS: located proxy-id 214e7ec6 (Progress.Web.InternalWebHandler:HandleRequest) for operation 16 (8458)
    [21/05/10@07:34:59.382-0400] P-006320 T-010268 4 AS-10 AS -- TRACE: cso4GL: After successful loadProc() (8458)
    [21/05/10@07:34:59.382-0400] P-006320 T-010268 4 AS-10 AS -- TRACE: Set open 4GL server state to 2. (8400)
    [21/05/10@07:34:59.382-0400] P-006320 T-010268 4 AS-10 AS -- TRACE: cso4GL: In execProc() - before execution. (8458)
    [21/05/10@07:34:59.382-0400] P-006320 T-010268 4 AS-10 AS -- TRACE: STATELESS: running stateless internal function on proxy-id 214e7ec6  (8458)
    [21/05/10@07:34:59.386-0400] P-006320 T-010268 1 AS-10 ORS_DBG        <Osprey.Framework.Globals  ServiceInterface_AfterActivated>  Begin
    [21/05/10@07:34:59.387-0400] P-006320 T-010268 1 AS-10 ORS_DBG        <Osprey.Framework.Globals  ServiceInterface_AfterActivated>  End
    [21/05/10@07:34:59.388-0400] P-006320 T-010268 1 AS-10 SmartWebHa     ##############################################################################################################################
    [21/05/10@07:34:59.388-0400] P-006320 T-010268 1 AS-10 SmartWebHa     ### Begin Web Handler Request: PUT /Entities/PhysicalInv/65002/PhyLine/2
    [21/05/10@07:34:59.388-0400] P-006320 T-010268 1 AS-10 SmartWebHa     ##############################################################################################################################
    [21/05/10@07:34:59.390-0400] P-006320 T-010268 1 AS-10 DataAccess     Client-Query: for each ePhyLine where ePhyLine.RunNum = "65002" and ePhyLine.LineNum = "2"
    [21/05/10@07:34:59.390-0400] P-006320 T-010268 1 AS-10 DataAccess     Default-Query: FOR EACH PhyLine, FIRST Item OF PhyLine INDEXED-REPOSITION
    [21/05/10@07:34:59.392-0400] P-006320 T-010268 1 AS-10 DataAccess     Prepare-Query: FOR EACH PhyLine WHERE PhyLine.RunNum = "65002" and PhyLine.LineNum = "2", FIRST Item OF PhyLine INDEXED-REPOSITION
    [21/05/10@07:34:59.392-0400] P-006320 T-010268 1 AS-10 DataAccess     Index Information on Buffer PhyLine: upRun
    [21/05/10@07:34:59.392-0400] P-006320 T-010268 1 AS-10 DataAccess     Index Information on Buffer Item: upItem
    [21/05/10@07:34:59.392-0400] P-006320 T-010268 1 AS-10 DataAccess     Restart-Rowid for Table ePhyLine: ?
    [21/05/10@07:34:59.392-0400] P-006320 T-010268 1 AS-10 DataAccess     Next-Rowid for Table ePhyLine: ?
    [21/05/10@07:34:59.392-0400] P-006320 T-010268 1 AS-10 DataAccess     Last-Batch for Table ePhyLine: yes
    [21/05/10@07:34:59.394-0400] P-006320 T-010268 1 AS-10 ORS_DBG        <Osprey.Pos.PhysicalInv.PhysicalInvBusinessEntity  ValidateData>:  Begin
    [21/05/10@07:34:59.394-0400] P-006320 T-010268 1 AS-10 BUFFER         Buffer ePhyLine: record with ROWID 0x0000000000025100
    [21/05/10@07:34:59.394-0400] P-006320 T-010268 1 AS-10 APPL            ROW-STATE: ROW-MODIFIED
    [21/05/10@07:34:59.394-0400] P-006320 T-010268 1 AS-10 APPL           ePhyLine.RunNum <integer>: 65002
    [21/05/10@07:34:59.394-0400] P-006320 T-010268 1 AS-10 APPL           ePhyLine.LineNum <integer>: 2
    [21/05/10@07:34:59.394-0400] P-006320 T-010268 1 AS-10 APPL           ePhyLine.ItemNum <character>: "         107"
    [21/05/10@07:34:59.394-0400] P-006320 T-010268 1 AS-10 APPL           ePhyLine.PackNum <integer>: 1
    [21/05/10@07:34:59.394-0400] P-006320 T-010268 1 AS-10 APPL           ePhyLine.RunDate <date>: ?
    [21/05/10@07:34:59.394-0400] P-006320 T-010268 1 AS-10 APPL           ePhyLine.Stat <integer>: 1
    [21/05/10@07:34:59.394-0400] P-006320 T-010268 1 AS-10 APPL           ePhyLine.Qty1 <decimal>: 100
    [21/05/10@07:34:59.394-0400] P-006320 T-010268 1 AS-10 APPL           ePhyLine.Qty2 <decimal>: -1
    [21/05/10@07:34:59.394-0400] P-006320 T-010268 1 AS-10 APPL           ePhyLine.Qty3 <decimal>: -1
    [21/05/10@07:34:59.394-0400] P-006320 T-010268 1 AS-10 APPL           ePhyLine.Qty4 <decimal>: -1
    [21/05/10@07:34:59.394-0400] P-006320 T-010268 1 AS-10 APPL           ePhyLine.Qty5 <decimal>: -1
    [21/05/10@07:34:59.394-0400] P-006320 T-010268 1 AS-10 APPL           ePhyLine.UpdDate <date>: ?
    [21/05/10@07:34:59.394-0400] P-006320 T-010268 1 AS-10 APPL           ePhyLine.Counter1 <character>: ""
    [21/05/10@07:34:59.394-0400] P-006320 T-010268 1 AS-10 APPL           ePhyLine.Counter2 <character>: ""
    [21/05/10@07:34:59.394-0400] P-006320 T-010268 1 AS-10 APPL           ePhyLine.Counter3 <character>: ""
    [21/05/10@07:34:59.394-0400] P-006320 T-010268 1 AS-10 APPL           ePhyLine.Counter4 <character>: ""
    [21/05/10@07:34:59.394-0400] P-006320 T-010268 1 AS-10 APPL           ePhyLine.UpcNum <character>: ""
    [21/05/10@07:34:59.394-0400] P-006320 T-010268 1 AS-10 APPL           ePhyLine.Counted <logical>: no
    [21/05/10@07:34:59.394-0400] P-006320 T-010268 1 AS-10 APPL           ePhyLine.Item_Descrpt <character>: ""
    [21/05/10@07:34:59.394-0400] P-006320 T-010268 1 AS-10 APPL           ePhyLine.AddToCounts <logical>: no
    [21/05/10@07:34:59.394-0400] P-006320 T-010268 1 AS-10 APPL           ePhyLine.VarianceCnt <decimal>: 0
    [21/05/10@07:34:59.394-0400] P-006320 T-010268 1 AS-10 APPL           ePhyLine.VarianceCost <decimal>: 0
    [21/05/10@07:34:59.394-0400] P-006320 T-010268 1 AS-10 APPL           ePhyLine.VarianceRetail <decimal>: 0
    [21/05/10@07:34:59.396-0400] P-006320 T-010268 1 AS-10 DataAccess     Client-Query: for each ePhysicalInv WHERE ePhysicalInv.RunNum = "65002"
    [21/05/10@07:34:59.396-0400] P-006320 T-010268 1 AS-10 DataAccess     Default-Query: FOR EACH PhysicalInv, FIRST CodeDef WHERE CodeDef.Type = 'phy status' AND CodeDef.IdNum = PhysicalInv.Stat OUTER-JOIN INDEXED-REPOSITION
    [21/05/10@07:34:59.397-0400] P-006320 T-010268 1 AS-10 DataAccess     Prepare-Query: FOR EACH PhysicalInv WHERE PhysicalInv.RunNum = "65002", FIRST CodeDef WHERE CodeDef.Type = 'phy status' AND CodeDef.IdNum = PhysicalInv.Stat OUTER-JOIN INDEXED-REPOSITION
    [21/05/10@07:34:59.397-0400] P-006320 T-010268 1 AS-10 DataAccess     Index Information on Buffer PhysicalInv: upRunNum
    [21/05/10@07:34:59.398-0400] P-006320 T-010268 1 AS-10 DataAccess     Index Information on Buffer CodeDef: upIdNum
    [21/05/10@07:34:59.398-0400] P-006320 T-010268 1 AS-10 DataAccess     Restart-Rowid for Table ePhysicalInv: ?
    [21/05/10@07:34:59.398-0400] P-006320 T-010268 1 AS-10 DataAccess     Next-Rowid for Table ePhysicalInv: ?
    [21/05/10@07:34:59.398-0400] P-006320 T-010268 1 AS-10 DataAccess     Last-Batch for Table ePhysicalInv: yes
    [21/05/10@07:34:59.399-0400] P-006320 T-010268 1 AS-10 ORS_DBG        <Osprey.Pos.PhysicalInv.PhysicalInvBusinessEntity  ValidateData>:  End
    [21/05/10@07:34:59.401-0400] P-006320 T-010268 1 AS-10 ORS_DBG        <PhysicalInvDataAccess  ePhyLineModifyBeginTrans>:  Begin
    [21/05/10@07:34:59.401-0400] P-006320 T-010268 1 AS-10 ORS_DBG        <PhysicalInvDataAccess  ePhyLineModifyBeginTrans>:  End
    [21/05/10@07:34:59.408-0400] P-006320 T-010268 1 AS-10 APPL           ########################################################################################################
    [21/05/10@07:34:59.408-0400] P-006320 T-010268 1 AS-10 APPL           Table Name                                  Record Reads         Updates         Creates         Deletes
    [21/05/10@07:34:59.408-0400] P-006320 T-010268 1 AS-10 APPL           --------------------------------------------------------------------------------------------------------
    [21/05/10@07:34:59.408-0400] P-006320 T-010268 1 AS-10 APPL           pos.CodeDef                                            2               0               0               0
    [21/05/10@07:34:59.408-0400] P-006320 T-010268 1 AS-10 APPL           --------------------------------------------------------------------------------------------------------
    [21/05/10@07:34:59.408-0400] P-006320 T-010268 1 AS-10 APPL           Index Name                                   Index Reads                         Creates         Deletes
    [21/05/10@07:34:59.408-0400] P-006320 T-010268 1 AS-10 APPL           --------------------------------------------------------------------------------------------------------
    [21/05/10@07:34:59.408-0400] P-006320 T-010268 1 AS-10 APPL           pos._Field._File/Field                                 6                               0               0
    [21/05/10@07:34:59.409-0400] P-006320 T-010268 1 AS-10 APPL           ########################################################################################################
    [21/05/10@07:34:59.409-0400] P-006320 T-010268 1 AS-10 SmartWebHa     ##############################################################################################################################
    [21/05/10@07:34:59.409-0400] P-006320 T-010268 1 AS-10 SmartWebHa     ### End Web Handler Request: PUT /Entities/PhysicalInv/65002/PhyLine/2
    [21/05/10@07:34:59.409-0400] P-006320 T-010268 1 AS-10 SmartWebHa     ### Request runtime: 20 msecs, Response Content Length: 0 bytes
    [21/05/10@07:34:59.409-0400] P-006320 T-010268 1 AS-10 SmartWebHa     ##############################################################################################################################
    [21/05/10@07:34:59.409-0400] P-006320 T-010268 3 AS-10 AS -- TRACE: SINGLETON Non-Void Method (Proxy 558792390) END SUCCESS.
    [21/05/10@07:34:59.409-0400] P-006320 T-010268 4 AS-10 AS -- TRACE: cso4GL: In execProc() - successful execution. (8458)
    [21/05/10@07:34:59.409-0400] P-006320 T-010268 4 AS-10 AS -- TRACE: cso4GL: In execCall() - execProc() success. (8458)
    [21/05/10@07:34:59.409-0400] P-006320 T-010268 4 AS-10 AS -- TRACE: Set open 4GL server state to 3. (8400)
    [21/05/10@07:34:59.409-0400] P-006320 T-010268 4 AS-10 AS Server Message state = MSGSTATE_SENDRESP
    [21/05/10@07:34:59.409-0400] P-006320 T-010268 4 AS-10 AS -- TRACE: Set open 4GL server state to 1. (8400)
    [21/05/10@07:34:59.410-0400] P-006320 T-010268 3 AS-10 AS -- TRACE: deactivation Procedure 'Consultingwerk/Framework/Server/as_deactivate.p' START (14244)
  9. Mike Fechner
    Mike Fechner avatar
    342 posts
    Registered:
    14 Sep 2016
    10 May 2021 in reply to Roger Blanchard
    Link to this post
    Hi Roger,

    I would assume, that in between this here you're missing a FIND FIRST ePhysicalInv. FetchRelatedRecords does not find the first record - it only populates the ProDataset with the related records.

            THIS-OBJECT:FetchRelatedRecords (BUFFER ePhyLine:HANDLE, "ePhysicalInv").
           
           IF NOT AVAILABLE ePhysicalInv THEN // we need our parent record to continue validation
    DatasetHelper:AddErrorString (BUFFER ePhyLine:HANDLE, SUBSTITUTE ("PhysicalInv record not found with RunNum=&1", ePhyLine.RunNum), "RunNum", "ePhyLine") .
  10. Roger Blanchard
    Roger Blanchard avatar
    413 posts
    Registered:
    29 Jun 2018
    Answered
    10 May 2021 in reply to Mike Fechner
    Link to this post
    Okay, thanks for the confirmation.

    I guess I have been lucky up until now!!

    Thanks again. 
10 posts, 1 answered