project QadFinancials > class BDebtorShipTo > 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/bdebtorshipto.p)

<ANCESTOR-CODE>

if icTableName = 'DebtorShipTo':U
then do:
    /* =============================================================== */
    /* Set the SharedSet-ID                                            */ 
    /* that is linked to the current company (viCompanyId)             */
    /* =============================================================== */
    <Q-1 run LookupSharedSetForCompany (all) (Read) (Cache)
          (input viCompanyID, (CompanyId)
           input {&SHAREDSETTYPECODE-DEBTOR}, (SharedSetType)
           output dataset tqSharedSetForCompany) in BCompany >
    find first tqSharedSetForCompany no-error.
    if available tqSharedSetForCompany
    then assign tDebtorShipTo.SharedSet_ID = tqSharedSetForCompany.tiSharedSet_ID.
end.