Using Session.Item to Find Values

Session.Item and Session.OriginalItem can be used to return values from the current record of a table. You specify the name of the column for which you want to retrieve or set a value. When setting values, you must run a Session.Item.Updatebatch method to commit the update.

Session.Item is used in the Finding a Manager in the User Directory example to specify the name of the field which contains the SAMAccountName.

The following are three examples that use the Session object:

Getting Values Example

Function GetValue(strFieldName)
'strFieldName is the name of the column that contains the data you are returning
   GetValue = session.item(strFieldName)
End Function 

Setting Values Example

Sub SetValue(strFieldName)
'strFieldName is the name of the column that contains the data to which 
	'you are appending the date
   Session.item(strFieldName) = session.item(strFieldName)& ' ' &  date
   Sesssion.item.updatebatch
End sub

Checking Value Example

Function CheckValue(strFieldName)
'strFieldName is the name of the column that contains the data you are comparing
  If session.item(strFieldName) <> session.originalitem(strFieldName) then
      'Do something
  End if
End function