CurrentContext (PIUser object)



The CurrentContext property is a Read/Write string that contains the PIUser's current context. If this has not been set by the application, the CurrentContext is identical to the DefaultContext. The CurrentContext is only maintained in memory during the program. Only changes to the DefaultContext property are persisted on the server. For a discussion on the use of context objects see PIContext .




The object placeholder is an object expression that evaluates to a PIUser object.



Only valid server contexts may be assigned to this property. For the list of available contexts on the server, look at the Server.PIContexts collection. To add a new context to the server use PIContexts.Add.


Trappable Errors

In addition to generic errors (such as Out of Memory), the following errors may occur:




Unable to retrieve data for a particular user from the server.


When setting the context the string must be non-blank.


When setting the CurrentContext the new string does not represent a valid context for this server.

Enabling Operational Intelligence