project BLF > class BCustomField > method Calculate

Description

Add code here to initialize the calculated fields of the class temp-tables after loading existing records from the application database.


Parameters


oiReturnStatusoutputinteger


Internal usage


unused


program code (program/bcustomfield.p)

<ANCESTOR-CODE>

for each tCustomField where tCustomField.tc_Status <> "N" on error undo, throw:

    /* Remove workaround for BLF-2137 */
    if num-entries(tCustomField.CustomFieldFieldName, ":") = 2
    then assign tCustomField.CustomFieldFieldName = entry(2, tCustomField.CustomFieldFieldName, ":").

    find t_iCustomField where
         t_iCustomField.tc_Rowid = tCustomField.tc_Rowid
         no-error.

    if not available t_iCustomField
    then do:
        assign oiReturnStatus = -3.
        return.
    end.

    assign tCustomField.tcLookupType   = if tCustomField.StoredSearch_ID = 0 or
                                            tCustomField.StoredSearch_ID = ?
                                         then ""
                                         else
                                         if tCustomField.tcStoredSearchLookupReference = "QAD.Browse.MfgProLookupProvider"
                                         then {&LOOKUPTYPE-BROWSE}
                                         else
                                         if index(tCustomField.tcStoredSearchLookupReference, ":") = 0
                                         then if tCustomField.tcStoredSearchName = {&LOOKUPTYPE-GENCODE}
                                              then {&LOOKUPTYPE-GENCODE}
                                              else {&LOOKUPTYPE-STOREDSEARCH}
                                         else {&LOOKUPTYPE-OTHER}
           t_iCustomField.tcLookupType = tCustomField.tcLookupType.
end.