How to set NO-FILL on an entitytable
 
Forums / SmartComponent Library - Developer Forum / How to set NO-FILL on an entitytable

How to set NO-FILL on an entitytable

4 posts, 0 answered
  1. Carl Verbiest
    Carl Verbiest avatar
    59 posts
    Registered:
    12 Oct 2018
    09 Apr 2019
    Link to this post
    We get error "Fill requires an attached datasource eCODAFAMILYDESC 11874" in the BE Tester, see screenshot https://i.imgur.com/Thui8yW.png

    The DESC tables in this BE are calculated and do not have a source buffer.

    What is the correct way to set NO-FILL ?

    The DataAccess contains the code below but we see that OnBeforeFill is not executed if the top table is not fetched.

        method override protected void DefineReadEvents ():

            this-object:SetDatasetCallback("BEFORE-FILL", "OnBeforeFill").

        end method.

        /**
         * Purpose: sets fill-mode to "NO-FILL" of the read-only temp-tables
         * @param   dsCODADOMAIN Dataset CODADOMAIN
         */
        method public void OnBeforeFill (input dataset dsCODADOMAIN):

            buffer eCODADOMAINDESC:fill-mode = "NO-FILL".
            buffer eCODAFAMILYDESC:fill-mode = "NO-FILL".
            buffer eCODASUBFAMILYDESC:fill-mode = "NO-FILL".

        end method.


  2. Mike Fechner
    Mike Fechner avatar
    319 posts
    Registered:
    14 Sep 2016
    09 Apr 2019 in reply to Carl Verbiest
    Link to this post
    The easiest is to exclude those tables from the Tables argument of the FetchDataRequest argument passed to the Data Access object's FetchData method.

    But setting it to NO-FILL like you did there works too. 

    Or you create a BEFORE-FILL callback for those tables as suggested by the error message.
  3. Carl Verbiest
    Carl Verbiest avatar
    59 posts
    Registered:
    12 Oct 2018
    10 Apr 2019 in reply to Mike Fechner
    Link to this post
    Hi Mike,

    The DESC tables are calculated tables containing descriptions of referenced records.
    The client decides whether he interested in the descriptions or not. This is done using the Tables property
    excluding those tables is not an option. The AssignSmartRecordInformation also uses Tables to determine which of the calculated tables should be created.

    The problem I have with the Onbeforefill on a buffer is that it fires too much, once for each parent record, the dataset beforefill is ok but that does not fire if the top table is not requested.

    I tried overriding DatasetFill but found that there are 2 almost identical methods
    DatasetBufferFill and DatasetBufferFill, they only differ in the assert and error message.

    I'm currently leaning toward overidding both methods in the CceDataAccess

    /* In CODADataAccess */
        method protected override void BeforeFill(phDataset as handle, poFetchDataRequest as IFetchDataRequest):

            buffer eCODADOMAINDESC:fill-mode = "NO-FILL".
            buffer eCODAFAMILYDESC:fill-mode = "NO-FILL".
            buffer eCODASUBFAMILYDESC:fill-mode = "NO-FILL".

        end method.

    /* In CceDataAccess */
        method protected override void BeforeFill(phDataset as handle, poFetchDataRequest as IFetchDataRequest):

            buffer eCODADOMAINDESC:fill-mode = "NO-FILL".
            buffer eCODAFAMILYDESC:fill-mode = "NO-FILL".
            buffer eCODASUBFAMILYDESC:fill-mode = "NO-FILL".

        end method.

        method protected override logical DatasetFill(phDataset as handle, poFetchDataRequest as IFetchDataRequest):
            this-object:BeforeFill(phDataset, poFetchDataRequest).
            return super:DatasetFill(phDataset, poFetchDataRequest).
        end method.

        method protected override logical DatasetBufferFill(phDataset as handle, poFetchDataRequest as IFetchDataRequest):

            this-object:BeforeFill(phDataset, poFetchDataRequest).
            return super:DatasetBufferFill(phDataset, poFetchDataRequest).

        end method.

  4. Mike Fechner
    Mike Fechner avatar
    319 posts
    Registered:
    14 Sep 2016
    10 Apr 2019 in reply to Carl Verbiest
    Link to this post
    A BEFORE-FILL callback on the Dataset? 
4 posts, 0 answered