project QadFinancials > class BExpenseGLMatrix > method ValExpenseCodeIsActive

validation procedure


Parameters


iiTargetFieldinputintegerValue of the business field to validate.
icTargetFieldCodeinputcharacter
icTargetFieldNameinputcharacterName of the business field to validate.
icRowidinputcharacterContents of field tc_Rowid, if the target field is a field of a component temp-table.
ilActiveinputlogical
icRequiredExpenseCodeTypeinputcharacter
icRequiredExpenseCodeTypeTRinputcharacter
icExpenseCodeTypeinputcharacter
oiReturnStatusoutputintegerReturn status of the method.


Internal usage


QadFinancials
validation on relation EMPLOYEEEXPENSECODEINEXPENSEGLMATRIX
validation on relation ITEMEXPENSECODEINEXPENSEGLMATRIX


program code (program1/bexpenseglmatrix.p)

/* ================================================= */
/* Check if the ID refers to an active component     */
/* Check if the Type of the expense-code is correct */
/* ================================================= */
if ilActive <> true
then do :
    assign vcMessage     = trim(substitute(#T-4'The expense code &1/&2 is not active. Select an active expense code.':255(1893)t-4#,icTargetFieldCode,string(iiTargetField)))
          oiReturnStatus = -1.
    <M-2 run SetMessage (input  vcMessage (icMessage),
                     input  '':U (icArguments),
                     input  icTargetFieldName (icFieldName),
                     input  string(iiTargetField) (icFieldValue),
                     input  'E':U (icType),
                     input  3 (iiSeverity),
                     input  icRowid (icRowid),
                     input  'QADFIN-1581':U (icFcMsgNumber),
                     input  '' (icFcExplanation),
                     input  '' (icFcIdentification),
                     input  '' (icFcContext),
                     output viFcReturnSuper (oiReturnStatus)) in BExpenseGLMatrix>
end. /* if ilActive <> true */
if icRequiredExpenseCodeType <> icExpenseCodeType
then do :
    assign vcMessage     = trim(substitute(#T-5'The expense code &1/&2 should be of type &3.':255(1894)t-5#,icTargetFieldCode,string(iiTargetField),icRequiredExpenseCodeTypeTR))
          oiReturnStatus = -1.
    <M-3 run SetMessage (input  vcMessage (icMessage),
                     input  '':U (icArguments),
                     input  icTargetFieldName (icFieldName),
                     input  string(iiTargetField) (icFieldValue),
                     input  'E':U (icType),
                     input  3 (iiSeverity),
                     input  icRowid (icRowid),
                     input  'QADFIN-1582':U (icFcMsgNumber),
                     input  '' (icFcExplanation),
                     input  '' (icFcIdentification),
                     input  '' (icFcContext),
                     output viFcReturnSuper (oiReturnStatus)) in BExpenseGLMatrix>
end. /* if icRequiredExpenseCodeType <> icExpenseCodeType */