project QadFinancials > class BAPMatching > method ValJournal

validation procedure

Description

ValJournal


Parameters


icTargetFieldinputcharacterValue of the business field to validate.
icTargetFieldNameinputcharacterName of the business field to validate.
icRowidinputcharacterContents of field tc_Rowid, if the target field is a field of a component temp-table.
icJournalTypeCodeinputcharacter
ilJournalIsActiveinputlogical
iiJournalLayerIDinputinteger
oiReturnStatusoutputintegerReturn status of the method.


Internal usage


QadFinancials
validation on relation JOURNALINAPMATCHING


program code (program4/bapmatching.p)

if ilJournalIsActive <> true
then do:
    assign vcMsgAPMatching = trim(substitute(#T-3'The selected daybook (&1) is not active.':199(56072)T-3#,icTargetField))
           oiReturnStatus  = -1.
    <M-1 run SetMessage
       (input  vcMsgAPMatching (icMessage), 
        input  '':U (icArguments), 
        input  icTargetFieldName (icFieldName), 
        input  icTargetField (icFieldValue), 
        input  'E':U (icType), 
        input  3 (iiSeverity), 
        input  icRowid (icRowid), 
        input  'QadFin-5641':U (icFcMsgNumber), 
        input  '':U (icFcExplanation), 
        input  '':U (icFcIdentification), 
        input  '':U (icFcContext), 
        output viFcReturnSuper (oiReturnStatus)) in BAPMatching>
end.

if icJournalTypeCode <> {&JOURNALTYPE-CIREC}
then do:
    assign vcMsgAPMatching = trim(substitute(#T-5'The type of selected daybook (&1) should be: &2.':199(56073)T-5#,icTargetField,trim({&JOURNALTYPE-CIREC-TR}))) + chr(10) + 
                             trim(substitute(#T-6'Current type: &1.':211(56074)T-6#,icJournalTypeCode))
           oiReturnStatus  = -1.
    <M-4 run SetMessage
       (input  vcMsgAPMatching (icMessage), 
        input  '':U (icArguments), 
        input  icTargetFieldName (icFieldName), 
        input  icTargetField (icFieldValue), 
        input  'E':U (icType), 
        input  3 (iiSeverity), 
        input  icRowid (icRowid), 
        input  'QadFin-5642':U (icFcMsgNumber), 
        input  '':U (icFcExplanation), 
        input  '':U (icFcIdentification), 
        input  '':U (icFcContext), 
        output viFcReturnSuper (oiReturnStatus)) in BAPMatching>
end.

<Q-7 run LayerByLayerIDLayerTypeCode (all) (Read) (NoCache)
   (input iiJournalLayerID, (LayerID)
    input ?, (LayerTypeCode)
    input ?, (LayerCode)
    output dataset tqLayerByLayerIDLayerTypeCode) in BLayer >
find first tqLayerByLayerIDLayerTypeCode no-lock no-error.
if available tqLayerByLayerIDLayerTypeCode and 
   tqLayerByLayerIDLayerTypeCode.tcLayerTypeCode <> {&LAYERTYPECODE-OFFICIAL}
then do :
    assign vcMsgAPMatching = trim(substitute(#T-9'The selected daybook (&1) should be in the official layer.':241(56075)T-9#,icTargetField,trim({&JOURNALTYPE-CIREC-TR})))
           oiReturnStatus  = -1.
    <M-8 run SetMessage
       (input  vcMsgAPMatching (icMessage), 
        input  '':U (icArguments), 
        input  icTargetFieldName (icFieldName), 
        input  icTargetField (icFieldValue), 
        input  'E':U (icType), 
        input  3 (iiSeverity), 
        input  icRowid (icRowid), 
        input  'QadFin-5643':U (icFcMsgNumber), 
        input  '':U (icFcExplanation), 
        input  '':U (icFcIdentification), 
        input  '':U (icFcContext), 
        output viFcReturnSuper (oiReturnStatus)) in BAPMatching>
end.