LogOnEntList(Int32,String,LogOnEntity[],Nullable<DateTime>,String) Method
- Last UpdatedNov 06, 2025
- 2 minute read
The LogOnEntList() method logs the specified user within a session on to their default entities, last saved entities, or a specified list of entities based on the list ID enumeration that is supplied.
If an entity list is being specified, this overload of the method specifies the list of entities by entity list enumeration.
'Declaration
Public Overloads Shared Sub LogOnEntList( _
ByVal sessionId As Integer, _
ByVal userId As String, _
ByVal entityList() As LogOnEntity, _
ByVal logOnTime As Nullable(Of Date), _
ByRef xmlLogOnFailures As String _
)
'Usage
Dim sessionId As Integer
Dim userId As String
Dim entityList() As LogOnEntity
Dim logOnTime As Nullable(Of Date)
Dim xmlLogOnFailures As String
Session.LogOnEntList(sessionId, userId, entityList, logOnTime, xmlLogOnFailures)
public static void LogOnEntList(
int sessionId,
string userId,
LogOnEntity[] entityList,
Nullable<DateTime> logOnTime,
out string xmlLogOnFailures
)
Parameters
- sessionId
Required. Holds the session ID and thus the user who is making this method call.
- userId
- Required. Holds the ID of the user who is being logged on.
- entityList
- Required. Holds an array of LogOnEntity objects that represent the list of entities to log the user on to.
- logOnTime
Optional. Holds the actual date/time the logon took place, to be entered in the Ent_Logon table. If null, defaults to the current time.
Passing a time for this parameter is useful when importing logon data from external timekeeping systems.
NOTE: The supplied date/time must be before the current time; if it is not, the current time is used.
- xmlLogOnFailures
- Output. Holds the returned error message if an error occurs during the execution of this method.
This user must be the current active user on the session, achieved by Starting the session or using the SwitchUser() method to become the active user on the session.
The entity lists and the cur_lab_cd and pct_lab_to_apply values for each entity in the list are saved in the Ui_Config table and are retrieved from there for this purpose.
If logging on from a predefined list, then the user is first logged off any entities they are currently logged on to for this session.
If specifying a custom list, then this method attempts to log on to the listed entities without first logging the user off any entities that they are currently logged onto for this session. This allows the client application to incrementally log on to groups of entities for a given user, if required.
The method inserts appropriate entries into the Ent_Logon table – one row per entity in the list. If the Certification option is licensed and an entity that already has a job running is logged on to, then the certification check to see that this user can run this job is performed. An error is returned if this user is not certified to run this job.
If the optional logOnTime attribute is included in a custom logon list, then its value must be before the current time; otherwise, the current time will be used instead. If a valid logOnTime is included, then all logon and labor tracking data will be based on this specified time.