AddEntity Method
- Last UpdatedNov 06, 2025
- 3 minute read
The AddEntity() method adds a new entity to the specified parent entity and returns the entity ID that is generated.
'Declaration
Public Shared Function AddEntity( _
ByVal entName As String, _
ByVal description As Fact.Common.DBString, _
ByVal parentEntID As Fact.Common.DBInt, _
ByVal site As Fact.Common.DBInt, _
ByVal hourlyCost As Fact.Common.DBDouble, _
ByVal canSchedJobs As Nullable(Of Boolean), _
ByVal canRunJobs As Nullable(Of Boolean), _
ByVal canCaptureUtil As Nullable(Of Boolean), _
ByVal canCaptureLabor As Nullable(Of Boolean), _
ByVal canDoDnc As Nullable(Of Boolean), _
ByVal canTrackOEE As Nullable(Of Boolean), _
ByVal canSchedShifts As Nullable(Of Boolean), _
ByVal canStore As Nullable(Of Boolean), _
ByVal canLogData As Nullable(Of Boolean), _
ByVal canShip As Nullable(Of Boolean), _
ByVal canReceive As Nullable(Of Boolean), _
ByVal canCopyFolders As Nullable(Of Boolean), _
ByVal curShiftID As Fact.Common.DBInt, _
ByVal curShiftStartTime As Fact.Common.DBDateTime, _
ByVal identicalJobExecs As Nullable(Of Integer), _
ByVal spare1 As Fact.Common.DBString, _
ByVal spare2 As Fact.Common.DBString, _
ByVal spare3 As Fact.Common.DBString, _
ByVal spare4 As Fact.Common.DBString _
) As Integer
public static int AddEntity(
string entName,
Fact.Common.DBString description,
Fact.Common.DBInt parentEntID,
Fact.Common.DBInt site,
Fact.Common.DBDouble hourlyCost,
Nullable<bool> canSchedJobs,
Nullable<bool> canRunJobs,
Nullable<bool> canCaptureUtil,
Nullable<bool> canCaptureLabor,
Nullable<bool> canDoDnc,
Nullable<bool> canTrackOEE,
Nullable<bool> canSchedShifts,
Nullable<bool> canStore,
Nullable<bool> canLogData,
Nullable<bool> canShip,
Nullable<bool> canReceive,
Nullable<bool> canCopyFolders,
Fact.Common.DBInt curShiftID,
Fact.Common.DBDateTime curShiftStartTime,
Nullable<int> identicalJobExecs,
Fact.Common.DBString spare1,
Fact.Common.DBString spare2,
Fact.Common.DBString spare3,
Fact.Common.DBString spare4
)
Parameters
- entName
- Required. Holds a string identifying the unique entity name.
- description
- Optional. Holds a string identifying the entity description.
- parentEntID
- Optional. Holds an integer identifying the parent entity ID. This value is null if at the top level.
- site
- Optional. Holds an integer identifying the ID of the ancestor entity that defines the site of this entity. If the value = entId, this entity is a site. It is null for entities above the site or for single-site systems.
- hourlyCost
- Optional. Holds the cost of running on this entity.
- canSchedJobs
- Optional. Holds a flag that, if set to true, indicates that jobs can be scheduled to this entity.
- canRunJobs
- Optional. Holds a flag that, if set to true, indicates that jobs can be run on this entity.
- canCaptureUtil
- Optional. Holds a flag that, if set to true, indicates that utilization data be captured on this entity.
- canCaptureLabor
- Optional. Holds a flag that, if set to true, indicates that labor data be captured on this entity.
- canDoDnc
- Optional. Not used. Will always be set to False.
- canTrackOEE
- Optional. Holds a flag that, if set to true, indicates that OEE statistics can be captured on this entity.
- canSchedShifts
- Optional. Holds a flag that, if set to true, indicates that shifts can be scheduled for this entity.
- canStore
- Optional. Holds a flag that, if set to true, indicates that this entity is a warehouse or storage location.
- canLogData
- Optional. Holds a flag that, if set to true, indicates that this entity can log data.
- canShip
- Optional. Holds a flag that, if set to true, indicates that shipments can be made from this entity,
- canReceive
- Optional. Holds a flag that, if set to true, indicates that material can be received at this entity,
- canCopyFolders
- Optional. Holds a flag that, if set to true, indicates that files in folders for this entity can be copied to its download directories.
- curShiftID
- Optional. Holds an integer indicating the current shift on this entity.
- curShiftStartTime
Optional. Holds a DateTime that indicates the current shift start time on the entity (the date is ignored).
- identicalJobExecs
- Optional. Holds an integer indicating the number of identical positions that can run independent jobs on this entity.
- spare1
Optional. Holds a string used to save information for this entity.
- spare2
Optional. Holds a string used to save information for this entity.
- spare3
Optional. Holds a string used to save information for this entity.
- spare4
Optional. Holds a string used to save information for this entity.
Return Value
Returns an integer value that is the entity ID assigned to the new entity that is created.