project QadFinancials > class BBudget > method ValidateComponentActiveVersionOnly

Description

This method contains the specific checks in case only the active budgetversions were loaded.


Parameters


oiReturnStatusoutputintegerReturn status of the method.


Internal usage


QadFinancials
method BBudget.ValidateComponent


program code (program5/bbudget.p)

/* ================================================================================================= */
    /* ValidateComponentActiveVersionOnly: method that contains the specific checks in case only the     */
    /* active budgetversions were loaded.                                                                */
    /* Note: Method DataLoadActiveOnly will - after the standard DataLoad is executed - remove the       */
    /* non-active budgetversions and their underlaying figures from the instance-data. To keep track of  */
    /* this situation, data-item vlActiveVersionOnly is set in this method and in method InitInstance    */
    /* and it is used to check upon in a submethod of ValidateComponent.                                 */
    /* ================================================================================================= */
    if vlActiveVersionOnly = false 
    then Return.
    else vcMessage = "":U.
    if can-find (first tBudget where tBudget.tc_Status <> "":U)
    then assign vcMessage = vcMessage + chr(10) + trim(#T-1'Unauthorized action on the budget.':250(17246)T-1#).
    if can-find (first tBudgetCompany where tBudgetCompany.tc_Status <> "":U)
    then assign vcMessage = vcMessage + chr(10) + trim(#T-4'Unauthorized action on the budget company links.':250(17245)t-4#).
    if can-find (first tBudgetPeriod where tBudgetPeriod.tc_Status <> "":U)
    then assign vcMessage = vcMessage + chr(10) + trim(#T-5'Unauthorized action on the budget period links.':250(17253)T-5#).
    if can-find (first tBudgetVersion where tBudgetVersion.tc_Status <> "":U)
    then assign vcMessage = vcMessage + chr(10) + trim(#T-7'Unauthorized action on the budget versions.':250(17249)T-7#). 
    if can-find (first tBudgetWBS where tBudgetWBS.tc_Status = "D":U)
    then assign vcMessage = vcMessage + chr(10) + trim(#T-14'Unauthorized Delete action on the budget WBS nodes.':250(17285)T-14#).
    if can-find (first tBudgetWBS where tBudgetWBS.tc_Status = "N":U)
    then assign vcMessage = vcMessage + chr(10) + trim(#T-10'Unauthorized Create action on the budget WBS nodes.':250(17281)T-10#).
    if vcMessage <> "":U
    then do :
        assign oiReturnStatus = -1
               vcMessage      = vcMessage + 
                                trim(#T-2'You can only update the figures of the budget WBS nodes because you are in restricted modification mode (only the active budget version).':250(17254)T-2#).
        <M-3 run SetMessage (input  vcMessage (icMessage), 
                     input  '':U (icArguments), 
                     input  '':U (icFieldName), 
                     input  '':U (icFieldValue), 
                     input  'E':U (icType), 
                     input  3 (iiSeverity), 
                     input  '':U (icRowid), 
                     input  'QADFIN-4247':U (icFcMsgNumber), 
                     input  '':U (icFcExplanation), 
                     input  '':U (icFcIdentification), 
                     input  '':U (icFcContext), 
                     output viFcReturnSuper (oiReturnStatus)) in BBudget>
        Return.
    end. /* if vcMessage <> "":U */