project BLF > class BReportDaemon > method ValEmail

validation procedure

Description

Return an error is the e-mail address of selected user is empty.


Parameters


icTargetFieldinputcharacterValue 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.
oiReturnStatusoutputintegerReturn status of the method.


Internal usage


BLF
validation on tfcDaemon.DaemonLogin


program code (program1/breportdaemon.p)

if  icTargetField <> ""
and icTargetField <> ?
then do:
    <Q-2 run UserByUsrLogin (all) (Read) (NoCache)
       (input icTargetField, (UsrLogin)
        output dataset tqUserByUsrLogin) in BUser >
    find first tqUserByUsrLogin no-error.
    if available tqUserByUsrLogin
    then if tqUserByUsrLogin.tcUsrMailAddress = ""
    then do:
        <M-1 run SetMessage
          (input  #T-1'Entered login must have a valid e-mail address.':255(9232)T-1# (icMessage), 
           input  '' (icArguments), 
           input  icTargetFieldName (icFieldName), 
           input  icTargetField (icFieldValue), 
           input  'E' (icType), 
           input  3 (iiSeverity), 
           input  icRowid (icRowid), 
           input  'BLF-130':U (icFcMsgNumber), 
           input  '' (icFcExplanation), 
           input  '' (icFcIdentification), 
           input  '' (icFcContext), 
           output viFcReturnSuper (oiReturnStatus)) in BReportDaemon>
        oiReturnStatus = -1.
    end.
end.