project QadFinancials > class BPeriod > method ValIsPostingAllowed
validation procedure
Description
Invoices, Purchases and Sales are only allowed in this period when the period also allows GL Postings.
Parameters
icTargetField | input | character | Value of the business field to validate. |
icTargetFieldName | input | character | Name of the business field to validate. |
icRowid | input | character | Contents of field tc_Rowid, if the target field is a field of a component temp-table. |
ilIsPostingGLAllowed | input | logical | Is Posting GL Allowed |
oiReturnStatus | output | integer | Return status of the method. |
Internal usage
QadFinancials
program code (program3/bperiod.p)
/* In case Periodic Costing is disabled, skip the validation on the periodic costing flag */
if icTargetFieldName = "t_sPeriod.PeriodIsPostingPCAllowed":U
then do:
if vlPeriodicCostingModIsActive = ?
then do:
<M-22 run PeriodicCostingModuleIsActive
(input vcDomainCode (icDomainCode),
output vlPeriodicCostingModIsActive (olPeriodicCostingModuleIsActive),
output viFcReturnSuper (oiReturnStatus)) in BPeriod>
end.
if not vlPeriodicCostingModIsActive then return.
end.
if not ilIsPostingGLAllowed and
can-do("true,yes":U, icTargetField)
then do:
assign vcMessage = trim(#T-2'You cannot set this field to Open when GL posting is not allowed.':255(3081)T-2#)
oiReturnStatus = -1.
<M-1 run SetMessage (input vcMessage (icMessage),
input '':U (icArguments),
input icTargetFieldName (icFieldName),
input icTargetField (icFieldValue),
input 'E':U (icType),
input 3 (iiSeverity),
input icRowid (icRowid),
input 'QADFIN-401':U (icFcMsgNumber),
input '' (icFcExplanation),
input '' (icFcIdentification),
input '' (icFcContext),
output viFcReturnSuper (oiReturnStatus)) in BPeriod>
end.