project BLF > class Session > method SetLogicalValue

Description

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


Parameters


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


Internal usage


BLF
method BDomain.SetDomainTypeAsSystem
method BResource.ApiSynchronize
method BSystem.ApiSynchronise
method Session.ApplicationLogin
method Session.ApplicationLoginFromUI
method Session.InitInstance
method Session.Login

QadFinancials
method BBankEntry.AdditionalUpdatesInvInstanceValidate
method BCInvoice.ApiCreateCreditorInvoices
method BCInvoice.CreateCInvoiceMovements
method BCInvoice.ValidateComponentPost
method BCompany.DataLoadByInput
method BCompanyProperty.SwitchPrimaryCompany
method BCompanyProperty.ValidateComponent
method BDebtorEndUser.AdditionalUpdates
method BDebtorEndUser.DataLoadByInput
method BDebtorShipTo.AdditionalUpdates
method BDebtorShipTo.DataLoadByInput
method BDomain.ApiSynchronise
method BDomain.DataLoadByInput
method BOpenItemAdjustment.OIAdjCommitSubCInvoice
method BPaymentSelection.AdditionalUpdatesUnconfirm
method BPeriod.ApiUpdatePeriodStatus
method BQCrossCyPosting.ApiProcessQCrossCyPostingForCI
method Session.SwitchCompany
method Session.ApplicationLogin
method Session.ApiSetReplicationEnabled


program code (program1/session.p)

if icName = "vlTranslationTracing":U
then assign vlTranslationTracing = ilValue.

find tDataItems where
     tDataItems.tcName     = icName and
     tDataItems.tcDataType = "l":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-3 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-411':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 = "l":U.
end.

assign tDataItems.tlLogValue = ilValue
       tDataItems.tlBusinessValue = (program-name(3) <> ?).

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