validation procedure
Description
check uniqueness of code
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. |
iiClassId | input | integer | |
iiReportId | input | integer | |
oiReturnStatus | output | integer | Return status of the method. |
Internal usage
BLF
program code (program1/breporttranslation.p)
if icTargetField = ""
or icTargetField = ?
then return.
<Q-1 run TranslationCodes (all) (Read) (NoCache)
(input icTargetField, (Code)
output dataset tqTranslationCodes) in BReportTranslation >
vlFcOk = no.
for each tqTranslationCodes where
tqTranslationCodes.tlReportTranslationIsSysDef = no and
tqTranslationCodes.tc_Rowid <> icRowid:
if tqTranslationCodes.tiReportBusComponent_ID = iiClassId
then do:
if tqTranslationCodes.tiReportBusActivity_ID = iiReportId
or tqTranslationCodes.tiReportBusActivity_ID = 0
or iiReportId = 0
then assign vlFcOk = yes.
end.
else if iiClassId = 0
then assign vlFcOk = yes.
end.
if vlFcOk
then do:
<M-2 run SetMessage
(input #T-3'This value already exists.':255(5103)t-3# (icMessage),
input '' (icArguments),
input icTargetFieldName (icFieldName),
input icTargetField (icFieldValue),
input 'E':U (icType),
input 3 (iiSeverity),
input icRowid (icRowid),
input 'BLF-150':U (icFcMsgNumber),
input '' (icFcExplanation),
input '' (icFcIdentification),
input '' (icFcContext),
output viFcReturnSuper (oiReturnStatus)) in BReportTranslation>
assign oiReturnStatus = -1.
end.
empty temp-table tqTranslationCodes.