validation procedure
Description
Checks to see if the selection code passed in exists in the system. Returns true or false.
Parameters
icSelectionCode | input | character | Selection Code |
oiReturnStatus | output | integer | Return status of the method. |
Internal usage
QadFinancials
program code (program3/bpaymentselection.p)
/* ensure that the icSelection code isn't blank */
if icSelectionCode = ? or
icSelectionCode = ""
then do:
assign
vcMessage = #T-23'Supplier Payment Selection Code cannot be blank':255(575763120)T-23#
oiReturnStatus = -1.
<M-5 run SetMessage
(input vcMessage (icMessage),
input '':U (icArguments),
input '':U (icFieldName),
input icSelectionCode (icFieldValue),
input 'E':U (icType),
input 3 (iiSeverity),
input '':U (icRowid),
input 'qadfin-456503':U (icFcMsgNumber),
input '' (icFcExplanation),
input '' (icFcIdentification),
input '' (icFcContext),
output viFcReturnSuper (oiReturnStatus)) in BPaymentSelection>
return.
end.
/* is it an existing payment selection? */
<Q-76 run PaySelPrim (all) (Read) (NoCache)
(input viCompanyId, (CompanyId)
input 0, (PaySel_ID)
input icSelectionCode, (PaySelCode)
output dataset tqPaySelPrim) in BPaymentSelection>
find first tqPaySelPrim where tqPaySelPrim.tcPaySelCode = icSelectionCode no-error.
if not available tqPaySelPrim
then do:
assign
oiReturnStatus = -1.
<M-30 run SetMessage
(input #T-50'Invalid selection Code Entered':255(786893276)T-50# (icMessage),
input '' (icArguments),
input '' (icFieldName),
input icSelectionCode (icFieldValue),
input '':U (icType),
input 2 (iiSeverity),
input '' (icRowid),
input 'qadfin-341435':U (icFcMsgNumber),
input '' (icFcExplanation),
input '' (icFcIdentification),
input '' (icFcContext),
output viFcReturnSuper (oiReturnStatus)) in BPaymentSelection>
end. /* if not available tqPaySelPrim */