validation procedure
Description
ValPostingTemplateID
Parameters
| iiTargetField | input | integer | 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. |
| iiPostingID | input | integer | PostingID |
| icPostingTemplateCode | input | character | PostingTemplateCode |
| icRecEntryCode | input | character | RecEntryCode |
| oiReturnStatus | output | integer | Return status of the method. |
Internal usage
QadFinancials
program code (program4/brecurringentry.p)
/* ============================================================ */
/* The posting for the selected template must be in a transient */
/* ============================================================ */
if iiPostingID = 0 or iiPostingID = ?
then do:
assign vcMessageRE = trim(substitute(#T-5'No postings are available for the selected posting template (&1).':150(3508)t-5#,trim(icPostingTemplateCode))) + chr(10) +
trim(substitute(#T-6'Recurring entry code: &1.':255(3493)T-6#,trim(icRecEntryCode)))
oiReturnStatus = -1.
<M-3 run SetMessage (input vcMessageRE (icMessage),
input '':U (icArguments),
input icTargetFieldName (icFieldName),
input string(iiTargetField) (icFieldValue),
input 'D':U (icType),
input 3 (iiSeverity),
input icRowid (icRowid),
input 'QADFIN-965':U (icFcMsgNumber),
input '' (icFcExplanation),
input '' (icFcIdentification),
input '' (icFcContext),
output viFcReturnSuper (oiReturnStatus)) in BRecurringEntry>
end.
<Q-1 run PostingByPostingId (all) (Read) (NoCache)
(input viCompanyId, (CompanyId)
input iiPostingID, (PostingId)
input ?, (JournalTypeCode)
output dataset tqPostingByPostingId) in BPosting >
find tqPostingByPostingId no-lock no-error.
if not available tqPostingByPostingId
then do:
assign vcMessageRE = trim(substitute(#T-7'No postings are available for the selected posting template (&1).':150(3508)t-7#,trim(icPostingTemplateCode))) + chr(10) +
trim(substitute(#T-8'Recurring entry code: &1.':255(3493)T-8#,trim(icRecEntryCode)))
oiReturnStatus = -1.
<M-4 run SetMessage (input vcMessageRE (icMessage),
input '':U (icArguments),
input icTargetFieldName (icFieldName),
input string(iiTargetField) (icFieldValue),
input 'E':U (icType),
input 3 (iiSeverity),
input icRowid (icRowid),
input 'QADFIN-966':U (icFcMsgNumber),
input '' (icFcExplanation),
input '' (icFcIdentification),
input '' (icFcContext),
output viFcReturnSuper (oiReturnStatus)) in BRecurringEntry>
end.