project QadFinancials > class BBalanceDaemon > method ValMaxNumberOfInstances

validation procedure

Description

Check if MaxNumberOfInstances is not > 1.


Parameters


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


Internal usage


QadFinancials
validation on tfcDaemon.DaemonMaxNumberOfInstances


program code (program4/bbalancedaemon.p)

if icDaemonName = {&BALANCEDAEMON} and iiTargetField > 1
then do:
    assign vcMessage      = trim(#T-1'You can only run one instance of the Balance daemon.':255(69454)t-1#)
           oiReturnStatus = -1.
    <M-2 run SetMessage
       (input  vcMessage (icMessage), 
        input  '':U (icArguments), 
        input  icTargetFieldName (icFieldName), 
        input  string(iiTargetField) (icFieldValue), 
        input  'E':U (icType), 
        input  3 (iiSeverity), 
        input  icRowid (icRowid), 
        input  'QadFin-8098':U (icFcMsgNumber), 
        input  '':U (icFcExplanation), 
        input  '':U (icFcIdentification), 
        input  '':U (icFcContext), 
        output viFcReturnSuper (oiReturnStatus)) in BBalanceDaemon>
end. /* if icDaemonName = {&BALANCEDAEMON} and integer(icTargetField) > 1 */