project BLF > class Session > method SetCharacterValue

Description

Change the value of any character data item in the session component.


Parameters


icNameinputcharacterName of the data item.
icValueinputcharactervalue of the data item
oiReturnStatusoutputintegerReturn status of the method.


Internal usage


BLF
method Session.ApplicationLogin
method Session.ApplicationLoginFromUI
method Session.CheckLogin
method Session.Login
method Session.SwitchCompany

QadFinancials
method BDebtorEndUser.ApiReplicateFromDaemon
method BDebtorShipTo.ApiReplicateFromDaemon
method BQBudgetActual.ApiDeleteQBudgetLinkActual
method BQBudgetCommitment.ApiDeleteQBudgetLinkCommit
method BQCInvoiceMovement.ApiProcessQCInvoiceMovement
method BQCrossCyPosting.ApiProcessQCrossCyPostingLogging
method BQDInvoiceMovement.ApiProcessQDInvoiceMovement
method BQPosting.ApiProcessQPostingLineSaf
method Session.SwitchCompany
method Session.ApplicationLogin


program code (program1/session.p)

find tDataItems where
     tDataItems.tcName     = icName and
     tDataItems.tcDataType = "c":U  no-error.
if available tDataItems
then do:
    /* do not allow external clients to overwrite business session values */
    if  program-name (3) = ?
    and tDataItems.tlBusinessValue
    then do:
        <M-4 run SetMessage
          (input  '[$1] is a read-only session value.':U (icMessage), 
           input  icName (icArguments), 
           input  '' (icFieldName), 
           input  '' (icFieldValue), 
           input  'S':U (icType), 
           input  3 (iiSeverity), 
           input  '' (icRowid), 
           input  'BLF-407':U (icFcMsgNumber), 
           input  '' (icFcExplanation), 
           input  '' (icFcIdentification), 
           input  '' (icFcContext), 
           output viFcReturnSuper (oiReturnStatus)) in Session>
        assign oiReturnStatus = -3.
        return.
    end.
end.
else do:
    create tDataItems.
    assign tDataItems.tcName     = icName
           tDataItems.tcDataType = "c":U.
end.

assign tDataItems.tcCharValue = icValue
       tDataItems.tlBusinessValue = (program-name(3) <> ?).

/* ======================================================================= */
/* Always update the cache with the current values                         */
/* ======================================================================= */
<M-2 run StartCacher (output vhFcComponent (ohCacher), 
                      output viFcReturnSuper (oiReturnStatus)) in Session>
<M-3 run SetCharacterValue
   (input  icName (icName), 
    input  icValue (icValue), 
    input  viFcCurrentInstanceId (iiSessionID), 
    output viFcReturnSuper (oiReturnStatus)) in Cacher>