validation procedure
Description
Validate if the project is not a template
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. |
ilIsTemplate | input | logical | Template |
icTargetFieldMsgParam | input | character | |
icProjectSystemStatus | input | character | |
oiReturnStatus | output | integer | Return status of the method. |
Internal usage
QadFinancials
program code (program4/bposting.p)
/* Templates are not allowed */
if ilIsTemplate = true
then do:
<M-1 run SetMessage (input trim(#T-4'Template projects are not allowed.':100(16568)T-4#) (icMessage),
input '':U (icArguments),
input icTargetFieldName (icFieldName),
input icTargetField (icFieldValue),
input 'E':U (icType),
input 3 (iiSeverity),
input icRowid (icRowid),
input 'QADFIN-1796':U (icFcMsgNumber),
input '':U (icFcExplanation),
input '':U (icFcIdentification),
input '':U (icFcContext),
output viFcReturnSuper (oiReturnStatus)) in BPosting>
assign oiReturnStatus = -1.
end.
/* System status must be OPEN or CLOSTCOSTS */
if icProjectSystemStatus <> {&PROJECTSYSTEMSTATUS-OPEN} and
icProjectSystemStatus <> {&PROJECTSYSTEMSTATUS-CLOSEDCOSTS}
then do:
<M-3 run SetMessage (input trim(#T-3'Only projects with system status $1 or $2 are allowed.':250(16566)T-3#) (icMessage),
input {&PROJECTSYSTEMSTATUS-OPEN-TR} + chr(2) + {&PROJECTSYSTEMSTATUS-CLOSEDCOSTS-TR} (icArguments),
input icTargetFieldName (icFieldName),
input icTargetField (icFieldValue),
input 'E':U (icType),
input 3 (iiSeverity),
input icRowid (icRowid),
input 'QADFIN-4031':U (icFcMsgNumber),
input '':U (icFcExplanation),
input '':U (icFcIdentification),
input '':U (icFcContext),
output viFcReturnSuper (oiReturnStatus)) in BPosting>
assign oiReturnStatus = -1.
end.