project BLF > class BDomain > 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/bdomain.p)

<ANCESTOR-CODE>


if icTableName = "domains":U
then do:
    /* create domainsharedset lines */
    assign vcListSharedSetTypeCode =  <M-4 GetSharedSetTypes () in BDomain>
           viNumberOfEntries       = num-entries(vcListSharedSetTypeCode, chr(2))
           viEntry                 = 1.
    /* for every SharedSetType create a new line */
    do while viEntry + 1 <= viNumberOfEntries:
        <M-2 run AddDetailLine (input  'DomainSharedSet':U (icTable), 
                        input  tDomains.tc_Rowid (icParentRowid), 
                        output viFcReturnSuper (oiReturnStatus)) in BDomain>
        if viFcReturnSuper <> 0
        then do:
            assign vcMessage =  #T-1'Add detail line for domain shared set failed':80(6676)T-1#.
            <M-3 run SetMessage (input  vcMessage (icMessage), 
                     input  '':U (icArguments), 
                     input  '':U (icFieldName), 
                     input  '':U (icFieldValue), 
                     input  'E':U (icType), 
                     input  2 (iiSeverity), 
                     input  '':U (icRowid), 
                     input  'BLF-70':U (icFcMsgNumber), 
                     input  '':U (icFcExplanation), 
                     input  '':U (icFcIdentification), 
                     input  '':U (icFcContext), 
                     output viFcReturnSuper (oiReturnStatus)) in BDomain>
            assign oiReturnStatus = -3.
        end.
        if available tDomainSharedSet
        then assign tDomainSharedSet.tcSharedSetTypeTranslated = entry(viEntry, vcListSharedSetTypeCode, chr(2))
                    tDomainSharedSet.tcSharedSetTypeCode       = entry(viEntry + 1, vcListSharedSetTypeCode, chr(2)).
        assign viEntry = viEntry + 2.
    end.
end.