Session variable migration tasks
These are migration tasks for session variables:
- Create a list of session variables used by custom code, and then, one session
variable at a time, determine which layouts have scripting that reference the
session variable. For session variables that are referenced in both the client and
server scripts, make the appropriate change as determined here:
- Ideal solution: Use
ClientSessionVariables
orServerSessionVariables
, but notClientServerSessionVariables
. One way to accomplish this is to make use of layout variables. Define aClientServerLayoutVariable
and set it to the value of theServerSessionVariable
. Then in the client script, use theClientServerLayoutVariable
instead of theClientSessionVariable
. Or you could move the client-side logic that references theClientSessionVariable
to the server side, and trigger the server-side script to execute by using either theAlertSelf
orAlertSelfFilterChanged
APIs. When usingAlertSelf
, move the logic to the server-sideOnAlert
handler. When usingAlertSelfFilterChanged
, move the logic to theOnFilterChanged
handler. - Alternative solution: Use
ClientServerSessionVariables
, but allow the server to only write it, never read it. Verify whether the session variable is safe to access from both the client and server. If so, use the(Get)ClientServerSessionVariables
API in both client and server scripting. The session variable is safe if it is not used for UI interactions or for performing database updates. If it is not safe, move the session variable to the server scripting. If you cannot move the code, use the(Get)ClientServerSessionVariables
API in both client and server scripting.
- Ideal solution: Use
- The filtering attributes in a field display format (FDF) may also reference
ClientServerSessionVariables
. The migration may convertSessionVariables
toClientServerSessionVariables
depending on the configuration.ClientServerSessionVariables
should all be changed toServerSessionVariables
.Create a list of FDFs that reference
ClientServerSessionVariables
, and then, one FDF at a time, determine whether it should reference aServerSessionVariable
instead.
To acquire a list of session variable names that need to be evaluated, search for all
layouts that contain SessionVariable
. Also, to get a list of FDFs that
must be evaluated, search all FDFs that reference
ClientServerSessionVariable
.
Note: We suggest using a
ClientServerSessionVariable
naming standard, such
as to append_CSSV
to each variable name.