project BLF > class BReportRequest > method InitialValues

Description

Add code here to initialize the calculated fields of a 'new' record (= a record that must be created in the application database) in a class temp-table.


Parameters


icTableNameinputcharacterName of the database table of which a record is created in the class temp-table.
oiReturnStatusoutputinteger


Internal usage


unused


program code (program/breportrequest.p)

/* requests and variants are created in the same table */
if icTableName = "RptRequest"
then do:
    assign tRptRequest.RptRequestType = "R".
    
    <M-1 run AddDetailLine
       (input  'RptRequestContext' (icTable), 
        input  tRptRequest.tc_Rowid (icParentRowid), 
        output viFcReturnSuper (oiReturnStatus)) in BReportRequest>
    if viFcReturnSuper <> 0
    then oiReturnStatus = viFcReturnSuper.
    if viFcReturnSuper < 0
    then return.
    /* should be available */
    if not available tRptRequestContext
    then find tRptRequestContext where tRptRequestContext.tc_Rowid = vcLastCreatedRowid.
    assign tRptRequestContext.RptRequestContextProperty = "CompanyCode"
           tRptRequestContext.RptRequestContextValue    = vcCompanyCode.
end.

<ANCESTOR-CODE>

if icTableName = "RptRequestContext"
then vcLastCreatedRowid = tRptRequestContext.tc_Rowid.

if icTableName = "ReportSchedule"
then vcLastCreatedRowid = tReportSchedule.tc_Rowid.