validation procedure
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. |
icPeriodStatus | input | character | |
ilPeriodIsPostingGLAllowed | input | logical | |
ilPeriodIsPostingPurchAllow | input | logical | Period.PeriodIsPostingPurchAllow |
oiReturnStatus | output | integer | Return status of the method. |
Internal usage
QadFinancials
program code (program4/bapmatching.p)
if icPeriodStatus <> {&PERIODSTATUS-OPEN}
then do:
<M-1 run SetMessage
(input trim(#T-1'The selected GL period must have status $1.':250(49038)T-1#) (icMessage),
input {&PERIODSTATUS-OPEN-TR} (icArguments),
input icTargetFieldName (icFieldName),
input icTargetField (icFieldValue),
input 'E':U (icType),
input 3 (iiSeverity),
input icRowid (icRowid),
input 'QadFin-5233':U (icFcMsgNumber),
input '':U (icFcExplanation),
input '':U (icFcIdentification),
input '':U (icFcContext),
output viFcReturnSuper (oiReturnStatus)) in BAPMatching>
assign oiReturnStatus = -1.
end.
if ilPeriodIsPostingGLAllowed <> true
then do:
<M-2 run SetMessage
(input trim(#T-2'The selected GL period must be open for postings.':250(49039)T-2#) (icMessage),
input '':U (icArguments),
input icTargetFieldName (icFieldName),
input icTargetField (icFieldValue),
input 'E':U (icType),
input 3 (iiSeverity),
input icRowid (icRowid),
input 'QadFin-5234':U (icFcMsgNumber),
input '':U (icFcExplanation),
input '':U (icFcIdentification),
input '':U (icFcContext),
output viFcReturnSuper (oiReturnStatus)) in BAPMatching>
assign oiReturnStatus = -1.
end.
find first t_sAPMatching where t_sAPMatching.tc_Rowid = icRowid no-error.
if not available t_sAPMatching
then return.
if ilPeriodIsPostingPurchAllow <> true and
t_sAPMatching.tlCInvoiceIsInitialStatus = true
then do:
<M-3 run SetMessage
(input trim(#T-4'The selected GL period must be open for AP transactions.':250(65001)t-4#) (icMessage),
input '':U (icArguments),
input icTargetFieldName (icFieldName),
input icTargetField (icFieldValue),
input 'E':U (icType),
input 3 (iiSeverity),
input icRowid (icRowid),
input 'QadFin-6881':U (icFcMsgNumber),
input '':U (icFcExplanation),
input '':U (icFcIdentification),
input '':U (icFcContext),
output viFcReturnSuper (oiReturnStatus)) in BAPMatching>
assign oiReturnStatus = -1.
end.