project QadFinancials > class BRecurringEntry > method ValRecEntryLinePostingDate

validation procedure

Description

ValRecEntryLinePostingDate


Parameters


itTargetFieldinputdateValue 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.
iiPeriodIDinputintegerPeriod_ID
icRecEntryCodeinputcharacterRecurring Entry Code
oiReturnStatusoutputintegerReturn status of the method.


Internal usage


QadFinancials
validation on tRecEntryLine.RecEntryLinePostingDate


program code (program4/brecurringentry.p)

/* =========================================== */
/* The Posting Date must be withing the period */
/* =========================================== */
<Q-1 run PeriodByStartEndDate (all) (Read) (NoCache)
          (input viCompanyId, (CompanyId)
           input itTargetField, (Date)
           output dataset tqPeriodByStartEndDate) in BPeriod >

find tqPeriodByStartEndDate where
     tqPeriodByStartEndDate.tcPeriodTypeCode = {&PERIODTYPECODE-NORMAL}
     no-lock no-error.
if not available tqPeriodByStartEndDate
then do:
    assign vcMessageRE    = trim(substitute(#T-4'There is no GL period available yet for the selected posting date (&1).':150(3506)T-4#, string(itTargetField) )) + chr(10) +
                            trim(substitute(#T-5'Recurring entry code: &1.':255(3493)T-5#,trim(icRecEntryCode)))
           oiReturnStatus = -1.
    <M-2 run SetMessage (input  vcMessageRE (icMessage),
                     input  '':U (icArguments),
                     input  icTargetFieldName (icFieldName),
                     input  string(itTargetField) (icFieldValue),
                     input  'E':U (icType),
                     input  3 (iiSeverity),
                     input  icRowid (icRowid),
                     input  'QADFIN-968':U (icFcMsgNumber),
                     input  '' (icFcExplanation),
                     input  '' (icFcIdentification),
                     input  '' (icFcContext),
                     output viFcReturnSuper (oiReturnStatus)) in BRecurringEntry>    
end.
else if iiPeriodID <> tqPeriodByStartEndDate.tiPeriod_ID
     then do:
         assign vcMessageRE    = trim(substitute(#T-6'The posting date (&1) is not in the selected GL period.':150(3507)T-6#, string(itTargetField) )) + chr(10) +
                                 trim(substitute(#T-7'Recurring entry code: &1.':255(3493)T-7#,trim(icRecEntryCode)))
                oiReturnStatus = -1.
         <M-3 run SetMessage (input  vcMessageRE (icMessage),
                     input  '':U (icArguments),
                     input  icTargetFieldName (icFieldName),
                     input  string(itTargetField) (icFieldValue),
                     input  'E':U (icType),
                     input  3 (iiSeverity),
                     input  icRowid (icRowid),
                     input  'QADFIN-973':U (icFcMsgNumber),
                     input  '' (icFcExplanation),
                     input  '' (icFcIdentification),
                     input  '' (icFcContext),
                     output viFcReturnSuper (oiReturnStatus)) in BRecurringEntry>         
     end.