project QadFinancials > class BYearClosing > method ValidateComponentAllLayer
Description
ValidateComponentAllJournal
Parameters
oiReturnStatus | output | integer | Return status of the method. |
Internal usage
QadFinancials
program code (program4/byearclosing.p)
/* =============================================================================== */
/* Validate Layer ofYear Closing */
/* IMPORTANT: This method is called from within the for each t_sYearClosing. */
/* So this record is available in this method. */
/* This can only be done when both methods are within the same segment. */
/* =============================================================================== */
/* Get details of the Layer */
<Q-44 run LayerByCodeTypeCode (all) (Read) (NoCache)
(input '':U, (LayerTypeCode)
input t_sYearClosing.tcLayerCode, (LayerCode)
output dataset tqLayerByCodeTypeCode) in BLayer>
find tqLayerByCodeTypeCode where
tqLayerByCodeTypeCode.tcLayerCode = t_sYearClosing.tcLayerCode
no-error.
if not available tqLayerByCodeTypeCode
then do:
assign vcMessage = #T-64'Layer &1 does not exist':30(924878227)T-64#
vcMessage = substitute(vcMessage, t_sYearClosing.tcLayerCode).
<M-62 run SetMessage
(input vcMessage (icMessage),
input '':U (icArguments),
input 'YearClosing.tcLayerCode' (icFieldName),
input t_sYearClosing.tcLayerCode (icFieldValue),
input 'E':U (icType),
input 3 (iiSeverity),
input t_sYearClosing.tc_Rowid (icRowid),
input 'qadfin-106170':U (icFcMsgNumber),
input '':U (icFcExplanation),
input '':U (icFcIdentification),
input '':U (icFcContext),
output viFcReturnSuper (oiReturnStatus)) in BYearClosing>
assign oiReturnStatus = -1.
return.
end.
/* Check, if the layer is or Official or Management */
if lookup(tqLayerByCodeTypeCode.tcLayerTypeCode, {&LAYERTYPECODE-OFFICIAL} + ",":U + {&LAYERTYPECODE-MANAGEMENT}) = 0
then do:
assign vcMessage = #T-53' Layer &1 is a transient layer. Year-end closing supports closing of official and management layers only.':255(750059930)T-53#
vcMessage = substitute(vcMessage, t_sYearClosing.tcLayerCode).
<M-68 run SetMessage
(input vcMessage (icMessage),
input '':U (icArguments),
input 'YearClosing.tcLayerCode' (icFieldName),
input t_sYearClosing.tcLayerCode (icFieldValue),
input 'E':U (icType),
input 3 (iiSeverity),
input t_sYearClosing.tc_Rowid (icRowid),
input 'qadfin-439514':U (icFcMsgNumber),
input '':U (icFcExplanation),
input '':U (icFcIdentification),
input '':U (icFcContext),
output viFcReturnSuper (oiReturnStatus)) in BYearClosing>
assign oiReturnStatus = -1.
return.
end. /* Check, if the layer is or Official or Management */
/* Check, if layer is active */
if not tqLayerByCodeTypeCode.tlLayerIsActive
then do:
assign vcMessage = #T-98'The layer is not active.':100(2722)T-98#.
<M-97 run SetMessage
(input vcMessage (icMessage),
input '':U (icArguments),
input 'YearClosing.tcLayerCode' (icFieldName),
input t_sYearClosing.tcLayerCode (icFieldValue),
input 'E':U (icType),
input 3 (iiSeverity),
input t_sYearClosing.tc_Rowid (icRowid),
input 'qadfin-446811':U (icFcMsgNumber),
input '':U (icFcExplanation),
input '':U (icFcIdentification),
input '':U (icFcContext),
output viFcReturnSuper (oiReturnStatus)) in BYearClosing>
assign oiReturnStatus = -1.
return.
end. /* if not tqLayerByCodeTypeCode.tlLayerIsActive */
assign t_sYearClosing.Layer_ID = tqLayerByCodeTypeCode.tiLayer_ID
t_sYearClosing.tcLayerCode = tqLayerByCodeTypeCode.tcLayerCode
t_sYearClosing.tcLayerDescription = tqLayerByCodeTypeCode.tcLayerDescription
t_sYearClosing.tcLayerTypeCode = tqLayerByCodeTypeCode.tcLayerTypeCode.