How to use the FetchRelatedRecords introduced by SCL-1975
 
Forums / SmartComponent Library - Developer Forum / How to use the FetchRelatedRecords introduced by SCL-1975

How to use the FetchRelatedRecords introduced by SCL-1975

5 posts, 0 answered
  1. Carl Verbiest
    Carl Verbiest avatar
    59 posts
    Registered:
    12 Oct 2018
    14 Dec 2018
    Link to this post
    I'm trying to use the newly created FetchRelatedRecords method.

    In the OntleningBusinessEntity

    eLEENHFD -> eLEENDET

    I added
    this-object:FetchRelatedRecords(buffer eLEENHFD:handle, "eLEENDET").
    this results in following error, see stack trace below
    do we need to start extra services in order to use this,
    do we need extra code in the businessentity ?
    BIB1 - OOT7. Ontlening - Detail -  000035 / An application error has occurred (Consultingwerk.OERA.Exceptions.BusinessServiceNotRunning)
    An Consultingwerk.OERA.Exceptions.BusinessServiceNotRunning has occurred:
    BusinessService  is not running.
    StopBusinessService Consultingwerk.OERA.ServiceManagerImpl at line 1357  (smartcomponentlibrary_utf8\Consultingwerk\OERA\ServiceManagerImpl.r)
    StopBusinessService Consultingwerk.OERA.ServiceManagerImpl at line 1325  (smartcomponentlibrary_utf8\Consultingwerk\OERA\ServiceManagerImpl.r)
    StopBusinessService Consultingwerk.OERA.ServiceManager at line 328  (smartcomponentlibrary_utf8\Consultingwerk\OERA\ServiceManager.r)
    FetchRelatedRecords Consultingwerk.OERA.BusinessEntity at line 881  (smartcomponentlibrary_utf8\Consultingwerk\OERA\BusinessEntity.r)
    ValidateData be.cce.server.ccebib.Ontlening.LeenhfdBusinessEntity at line 268  (smarttraining\TrainingBackend\src\be\cce\server\ccebib\Ontlening\LeenhfdBusinessEntity.r)
    SaveChanges Consultingwerk.OERA.BusinessEntity at line 1931  (smartcomponentlibrary_utf8\Consultingwerk\OERA\BusinessEntity.r)
    SaveChanges be.cce.SmartTools.OERA.CceBusinessEntity at line 53  (ccesmarttools\CceSmartTools\src\be\cce\SmartTools\OERA\CceBusinessEntity.r)
    SaveChanges be.cce.server.ccebib.Ontlening.LeenhfdBusinessEntity at line 576  (smarttraining\TrainingBackend\src\be\cce\server\ccebib\Ontlening\LeenhfdBusinessEntity.r)
    SaveChanges Consultingwerk.OERA.BusinessEntity at line 1966  (smartcomponentlibrary_utf8\Consultingwerk\OERA\BusinessEntity.r)
    SaveChanges Consultingwerk.OERA.ServiceInterface at line 4697  (smartcomponentlibrary_utf8\Consultingwerk\OERA\ServiceInterface.r)
    OERA/support/proSIsubmit.p at line 1849  (smartcomponentlibrary_utf8\OERA\support\proSIsubmit.r)
    SubmitData Consultingwerk.OERA.ServiceAdapter at line 7934  (smartcomponentlibrary_utf8\Consultingwerk\OERA\ServiceAdapter.r)
    SubmitChangesToBackend Consultingwerk.SmartComponents.Implementation.SmartBusinessEntityAdapter at line 4466  (smartcomponentlibrary_utf8\Consultingwerk\SmartComponents\Implementation\SmartBusinessEntityAdapter.r)
    SubmitChanges Consultingwerk.SmartComponents.Implementation.SmartBusinessEntityAdapter at line 4373  (smartcomponentlibrary_utf8\Consultingwerk\SmartComponents\Implementation\SmartBusinessEntityAdapter.r)
    SubmitChanges Consultingwerk.SmartComponents.Base.SmartDatasetAdapter at line 3425  (smartcomponentlibrary_utf8\Consultingwerk\SmartComponents\Base\SmartDatasetAdapter.r)
    UpdateRow Consultingwerk.SmartComponents.Base.SmartDatasetAdapter at line 3665  (smartcomponentlibrary_utf8\Consultingwerk\SmartComponents\Base\SmartDatasetAdapter.r)
    UpdateRow Consultingwerk.SmartComponents.Implementation.SmartDatasetChildAdapter at line 1652  (smartcomponentlibrary_utf8\Consultingwerk\SmartComponents\Implementation\SmartDatasetChildAdapter.r)
    UpdateRow Consultingwerk.SmartComponents.Base.SmartDatasetAdapter at line 3452  (smartcomponentlibrary_utf8\Consultingwerk\SmartComponents\Base\SmartDatasetAdapter.r)
    SaveChanges Consultingwerk.SmartComponents.Base.SmartViewerControl at line 5240  (smartcomponentlibrary_utf8\Consultingwerk\SmartComponents\Base\SmartViewerControl.r)
    ProcessCommand be.cce.SmartTools.SmartFramework.Tools.TableIOHandler at line 229  (ccesmarttools\CceSmartTools\src\be\cce\SmartTools\SmartFramework\Tools\TableIOHandler.r)
    ProcessTableIoTargetCommand be.cce.SmartTools.SmartComponents.CceBaseForm at line 1144  (ccesmarttools\CceSmartTools\src\be\cce\SmartTools\SmartComponents\CceBaseForm.cls)
    KeyDownHandler be.cce.SmartTools.SmartComponents.CceBaseForm at line 1124  (ccesmarttools\CceSmartTools\src\be\cce\SmartTools\SmartComponents\CceBaseForm.cls)
    DoWait be.cce.ccetools.menu.OutlookMenu at line 1875  (ccesmarttools\CceSmartTools\src\be\cce\ccetools\menu\OutlookMenu.cls)
    C:/Users/cvb/git/ccesmarttools/CceSmartTools/src/ccetools/mainnet-b.p at line 3350  (ccesmarttools\CceSmartTools\src\ccetools\mainnet-b.r)
    ccesmarttools\CceSmartTools\src\ccetools\main-b.p at line 103  (ccesmarttools\CceSmartTools\src\ccetools\main-b.r)
    adecomm/_runcode.p at line 675  (adecomm/_runcode.r)
    C:\Progress\eclipse473oedtstudio1174\plugins\com.openedge.pdt.debug.core_11.7.4.00\abl\_debuglauncher.p at line 100  (C:\Progress\eclipse473oedtstudio1174\plugins\com.openedge.pdt.debug.core_11.7.4.00\abl\_debuglauncher.p)
     
  2. Carl Verbiest
    Carl Verbiest avatar
    59 posts
    Registered:
    12 Oct 2018
    14 Dec 2018 in reply to Carl Verbiest
    Link to this post
    The error is caused by the finally block of FetchRelatedRecords,

    ServiceManager:StopBusinessService  is called even if there is an error before cEntityKey is determined.

    In that case the error of stopbusiness service fails and hides the real error, in our case "no eLEENHFD record is available".

    I fixed this locally by adding

                if cEntityKey > "" then ServiceManager:StopBusinessService (cEntityKey) .
     
  3. Mike Fechner
    Mike Fechner avatar
    319 posts
    Registered:
    14 Sep 2016
    16 Dec 2018 in reply to Carl Verbiest
    Link to this post
    Carl, please log this as an issue at https://support.consultingwerkcloud.com

    We need to investigate why this is failing for you. 
  4. Mike Fechner
    Mike Fechner avatar
    319 posts
    Registered:
    14 Sep 2016
    16 Dec 2018 in reply to Carl Verbiest
    Link to this post

    do we need to start extra services in order to use this


    no.


    do we need extra code in the businessentity ?


    The buffer passed to the method needs to contain a valid record.
  5. Carl Verbiest
    Carl Verbiest avatar
    59 posts
    Registered:
    12 Oct 2018
    18 Dec 2018 in reply to Mike Fechner
    Link to this post
    posted SCLSUP-104
     
5 posts, 0 answered