LogOnEnt(Int32,String,String,String,DBString,DBDouble,DBString,DBDateTime) Method
- Last UpdatedNov 06, 2025
- 2 minute read
The LogOnEnt() method logs the active user onto a specific entity within a session.
If an entity is being specified, this overload of the method specifies the entity by its entity name and site name.
'Declaration
Public Overloads Shared Sub LogOnEnt( _
ByVal sessionId As Integer, _
ByVal userId As String, _
ByVal entName As String, _
ByVal siteName As String, _
ByVal curLabCd As DBString, _
ByVal pctLabToApply As DBDouble, _
ByVal curLabDeptId As DBString, _
ByVal logOnTime As DBDateTime _
)
'Usage
Dim sessionId As Integer
Dim userId As String
Dim entName As String
Dim siteName As String
Dim curLabCd As DBString
Dim pctLabToApply As DBDouble
Dim curLabDeptId As DBString
Dim logOnTime As DBDateTime
Session.LogOnEnt(sessionId, userId, entName, siteName, curLabCd, pctLabToApply, curLabDeptId, logOnTime)
public static void LogOnEnt(
int sessionId,
string userId,
string entName,
string siteName,
DBString curLabCd,
DBDouble pctLabToApply,
DBString curLabDeptId,
DBDateTime logOnTime
)
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.
- entName
- Required. Holds the name of the entity that the user is logging on to.
- siteName
- Required. Holds the site name of the entity that the user is logging on to.
- curLabCd
- Optional. Holds the labor code to be used for this entry. Defaults to null, which means that labor data is not collected.
- pctLabToApply
- Optional. Holds the percentage of labor hours to be applied to this entry. Defaults to 100% if the labor code is included; otherwise, is null.
- curLabDeptId
- Optional. Holds the ID of the labor department to be used for this entry. Defaults to null, which means that labor data is not collected.
- logOnTime
Optional. Holds the actual date/time the logon took place. 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.
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, otherwise the method will fail. If the method succeeds, it inserts an entry into the Ent_Logon table.
If the Labor Collection module is licensed, then an entry will also be made in the Labor_Usage table. If the current user already has any active entries in the Labor_Usage table (determined by the Active flag), then those entries will be closed off (i.e., their durations updated) and new entries will be created for all these entries with appropriate pct_to_apply splitting percentages.
If a valid LogOnTime is included, then all logon and labor tracking data will be based on this specified time.
This method replaces the existing EntLogin() method.