project QadFinancials > class BCompanyGroup > method ValidateComponentPostCyGroup

Description

Validate component data


Parameters


oiReturnStatusoutputintegerReturn status of the method.


Internal usage


QadFinancials
method BCompanyGroup.ValidateComponentPost


program code (program1/bcompanygroup.p)

/* ====================================================================================== *
 * Method       : ValidatecomponentPostCyGroup                                            *
 * ====================================================================================== */
 
/* ============================================================================================ *
 * Perform validation for CyGroup record                                                        *
 * ============================================================================================ */

/* Precondition */
if not available t_sCyGroup
then do:
    assign vcMessage = #T-93'There is missing t_sCyGroup record.':255(29026699)T-93#.
    <M-18 run SetMessage
       (input  vcMessage (icMessage), 
        input  '':U (icArguments), 
        input  '':U (icFieldName), 
        input  '':U (icFieldValue), 
        input  'S':U (icType), 
        input  3 (iiSeverity), 
        input  '':U (icRowid), 
        input  'qadfin-755259':U (icFcMsgNumber), 
        input  '':U (icFcExplanation), 
        input  '':U (icFcIdentification), 
        input  '':U (icFcContext), 
        output viFcReturnSuper (oiReturnStatus)) in BCYGroup>
    assign oiReturnStatus = -1.
    return.
end.

/* ============================================================================================ *
 * Entity group has to have defined at least one entity                                         *
 * ============================================================================================ */
if t_sCyGroup.CyGroupIsActive = true                                              and
   t_sCyGroup.tc_Status <> 'D':U                                                  and
   not can-find(first t_sCyGroupCompany where
                      t_sCyGroupCompany.tc_ParentRowid   = t_sCyGroup.tc_Rowid and
                      t_sCyGroupCompany.tc_Status       <> 'D':U)
then do:
    assign vcMessage = #T-76'You must select at least one entity.':255(482391233)T-76#.
    <M-37 run SetMessage
       (input  vcMessage (icMessage), 
        input  '':U (icArguments), 
        input  '':U (icFieldName), 
        input  '':U (icFieldValue), 
        input  'E':U (icType), 
        input  3 (iiSeverity), 
        input  t_sCyGroup.tc_Rowid (icRowid), 
        input  'qadfin-222073':U (icFcMsgNumber), 
        input  '':U (icFcExplanation), 
        input  '':U (icFcIdentification), 
        input  '':U (icFcContext), 
        output viFcReturnSuper (oiReturnStatus)) in BCompanyGroup>
    assign oiReturnStatus = -1.
end.