project QadFinancials > class BDebtor > method ValBLWIGroup

Description

Validates BLWI Group field.
Note: work with t_s tables


Parameters


oiReturnStatusoutputintegerReturn status of the method.


Internal usage


QadFinancials
method BDebtor.PostValidateComponent


program code (program1/bdebtor.p)

/*error: BLWIGroup must exist - checked by FC*/
/*error: BLWIGroup must be active*/
if t_sDebtor.BLWIGroup_ID <> 0 and 
   t_sDebtor.BLWIGroup_ID <> ? and 
   (t_sDebtor.tc_Status = "N":U or 
    (t_sDebtor.tc_Status = "C" and 
     can-find (t_iDebtor where 
               t_iDebtor.tc_Rowid      = t_sDebtor.tc_Rowid and 
               t_iDebtor.BLWIGroup_ID <> t_sDebtor.BLWIGroup_ID )))
then do:
    <Q-2 run BLWIGroupByIdCode (all) (Read) (Cache)
       (input t_sDebtor.BLWIGroup_ID, (BLWIGroupId)
        input ?, (BLWIGroupCode)
        output dataset tqBLWIGroupByIdCode) in BBLWIGroup>
    find first tqBLWIGroupByIdCode no-error.
    if available tqBLWIGroupByIdCode and
       not tqBLWIGroupByIdCode.tlBLWIGroupIsActive
    then do:
        assign vcMessage     = trim(substitute(#T-4'The BLWI group (&1) is not active.':200(1426)T-4#, 
                                                trim(tqBLWIGroupByIdCode.tcBLWIGroupCode))) + chr(10) + 
                               program-name(1)
              oiReturnStatus = -1.
        <M-3 run SetMessage (input  vcMessage (icMessage),
                     input  '':U (icArguments),
                     input  'tDebtor.tcBLWIGroupCode':U (icFieldName),
                     input  t_sDebtor.tcBLWIGroupCode (icFieldValue),
                     input  'E':U (icType),
                     input  3 (iiSeverity),
                     input  t_sDebtor.tc_Rowid (icRowid),
                     input  'QADFIN-324':U (icFcMsgNumber),
                     input  '' (icFcExplanation),
                     input  '' (icFcIdentification),
                     input  '' (icFcContext),
                     output viFcReturnSuper (oiReturnStatus)) in BDebtor>        
    end.
end.