Add(Int32,String,DBString,DBInt,DBInt,DBDouble,Nullable<Boolean>,Nullable<Boolean>,Nullable<Boolean>,Nullable<Boolean>,Nullable<Boolean>,Nullable<Boolean>,Nullable<Boolean>,Nullable<Boolean>,Nullable<Boolean>,Nullable<Boolean>,Nullable<Boolean>,Nullable<Boolean>,Nullable<Boolean>,Nullable<Boolean>,Nullable<Boolean>,Nullable<Boolean>,Nullable<Boolean>,Nullable<Boolean>,Nullable<Boolean>,DBInt,DBDateTime,DBDateTime,DBString,DBString,Nullable<Int32>,Nullable<Boolean>,Nullable<Boolean>,DBString,DBString,DBString,DBString,DBString,DateTime,Int32) Method
- Last UpdatedMar 17, 2026
- 8 minute read
The Add() method adds a new entity to the Ent table.
This overload of the method includes the following input parameters:
- canCaptureQmData
- entityFromGalaxy
- canSchedJobsFromGalaxy
- canRunJobsFromGalaxy
- canCaptureUtilFromGalaxy
- canTrackOeeFromGalaxy
- canStoreFromGalaxy
'Declaration
Public Overloads Shared Sub Add( _
ByVal sessionId As Integer, _
ByVal entName As String, _
ByVal description As DBString, _
ByVal parentEntId As DBInt, _
ByVal site As DBInt, _
ByVal hourlyCost As 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 canCaptureQmData As Nullable(Of Boolean), _
ByVal entityFromGalaxy As Nullable(Of Boolean), _
ByVal canSchedJobsFromGalaxy As Nullable(Of Boolean), _
ByVal canRunJobsFromGalaxy As Nullable(Of Boolean), _
ByVal canCaptureUtilFromGalaxy As Nullable(Of Boolean), _
ByVal canTrackOeeFromGalaxy As Nullable(Of Boolean), _
ByVal canStoreFromGalaxy As Nullable(Of Boolean), _
ByVal curShiftId As DBInt, _
ByVal curShiftStartTimeLocal As DBDateTime, _
ByVal lastDomainChange As DBDateTime, _
ByVal treeIcon As DBString, _
ByVal flowDiagramImage As DBString, _
ByVal identicalJobExecs As Nullable(Of Integer), _
ByVal showInDSPTree As Nullable(Of Boolean), _
ByVal entClass As Nullable(Of Boolean), _
ByVal spare1 As DBString, _
ByVal spare2 As DBString, _
ByVal spare3 As DBString, _
ByVal spare4 As DBString, _
ByVal lastEditComment As DBString, _
ByRef lastEditAt As Date, _
ByRef entId As Integer _
)
'Usage
Dim sessionId As Integer
Dim entName As String
Dim description As DBString
Dim parentEntId As DBInt
Dim site As DBInt
Dim hourlyCost As DBDouble
Dim canSchedJobs As Nullable(Of Boolean)
Dim canRunJobs As Nullable(Of Boolean)
Dim canCaptureUtil As Nullable(Of Boolean)
Dim canCaptureLabor As Nullable(Of Boolean)
Dim canDoDNC As Nullable(Of Boolean)
Dim canTrackOEE As Nullable(Of Boolean)
Dim canSchedShifts As Nullable(Of Boolean)
Dim canStore As Nullable(Of Boolean)
Dim canLogData As Nullable(Of Boolean)
Dim canShip As Nullable(Of Boolean)
Dim canReceive As Nullable(Of Boolean)
Dim canCopyFolders As Nullable(Of Boolean)
Dim canCaptureQmData As Nullable(Of Boolean)
Dim entityFromGalaxy As Nullable(Of Boolean)
Dim canSchedJobsFromGalaxy As Nullable(Of Boolean)
Dim canRunJobsFromGalaxy As Nullable(Of Boolean)
Dim canCaptureUtilFromGalaxy As Nullable(Of Boolean)
Dim canTrackOeeFromGalaxy As Nullable(Of Boolean)
Dim canStoreFromGalaxy As Nullable(Of Boolean)
Dim curShiftId As DBInt
Dim curShiftStartTimeLocal As DBDateTime
Dim lastDomainChange As DBDateTime
Dim treeIcon As DBString
Dim flowDiagramImage As DBString
Dim identicalJobExecs As Nullable(Of Integer)
Dim showInDSPTree As Nullable(Of Boolean)
Dim entClass As Nullable(Of Boolean)
Dim spare1 As DBString
Dim spare2 As DBString
Dim spare3 As DBString
Dim spare4 As DBString
Dim lastEditComment As DBString
Dim lastEditAt As Date
Dim entId As Integer
Ent.Add(sessionId, entName, description, parentEntId, site, hourlyCost, canSchedJobs, canRunJobs, canCaptureUtil, canCaptureLabor, canDoDNC, canTrackOEE, canSchedShifts, canStore, canLogData, canShip, canReceive, canCopyFolders, canCaptureQmData, entityFromGalaxy, canSchedJobsFromGalaxy, canRunJobsFromGalaxy, canCaptureUtilFromGalaxy, canTrackOeeFromGalaxy, canStoreFromGalaxy, curShiftId, curShiftStartTimeLocal, lastDomainChange, treeIcon, flowDiagramImage, identicalJobExecs, showInDSPTree, entClass, spare1, spare2, spare3, spare4, lastEditComment, lastEditAt, entId)
public static void Add(
int sessionId,
string entName,
DBString description,
DBInt parentEntId,
DBInt site,
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,
Nullable<bool> canCaptureQmData,
Nullable<bool> entityFromGalaxy,
Nullable<bool> canSchedJobsFromGalaxy,
Nullable<bool> canRunJobsFromGalaxy,
Nullable<bool> canCaptureUtilFromGalaxy,
Nullable<bool> canTrackOeeFromGalaxy,
Nullable<bool> canStoreFromGalaxy,
DBInt curShiftId,
DBDateTime curShiftStartTimeLocal,
DBDateTime lastDomainChange,
DBString treeIcon,
DBString flowDiagramImage,
Nullable<int> identicalJobExecs,
Nullable<bool> showInDSPTree,
Nullable<bool> entClass,
DBString spare1,
DBString spare2,
DBString spare3,
DBString spare4,
DBString lastEditComment,
out DateTime lastEditAt,
out int entId
)
Parameters
- sessionId
- Required. Holds the session ID and thus the user who is making this method call.
- entName
- Required. Holds the name of the entity.
- description
- Optional. Holds the description of the entity.
- parentEntId
- Optional. Holds the ID of the parent entity for this new entity. If null, this entity will be a top-level entity.
- site
- Optional. Holds the ID of the ancestor entity that defines the site at which this entity is located. If null, the entity is above sites or sites are not being used in the system.
- hourlyCost
- Optional. Holds the cost of running this entity per hour.
- canSchedJobs
- Optional. Holds a flag that, if set to true, specifies that jobs can be scheduled to this entity. The default is false.
- canRunJobs
- Optional. Holds a flag that, if set to true, specifies that jobs can be run on this entity. The default is true.
- canCaptureUtil
- Optional. Holds a flag that, if set to true, specifies that this entity can capture utilization, subject to the number of available licenses. The default is true.
- canCaptureLabor
- Optional. Holds a flag that, if set to true, specifies that this entity can capture labor data. The default is false.
- canDoDNC
- Optional. Not used. Will always be set to false.
- canTrackOEE
- Optional. Holds a flag that, if set to true, specifies that this entity can capture OEE statistics. The default is false.
- canSchedShifts
- Optional. Holds a flag that indicates whether this entity can schedule shifts. If set to true, this entity will have its own shift schedules. If set to false, the shift schedules are inherited from this entity's preferred parent or from its nearest ancestor that can schedule shifts. The default is false.
- canStore
- Optional. Holds a flag that, if set to true, specifies that this entity can store items, and thus can be used as a storage location. The default is false.
- canLogData
- Optional. Holds a flag that, if set to true, specifies that this entity can log data. The default is false.
- canShip
- Optional. Holds a flag that, if set to true, specifies that materials can be shipped from this entity. The default is false.
- canReceive
- Optional. Holds a flag that, if set to true, specifies that materials can be received at this entity. The default is false.
- canCopyFolders
- Optional. Holds a flag that, if set to true, specifies that the files in folders for this entity can be copied to its download directories. The default is true.
- canCaptureQmData
- Optional. Holds the flag that, if set to true, specifies that QM data can be captured on this entity. The default is false.
- entityFromGalaxy
- Optional. Holds a flag that, if true, indicates that the entity is configured in a System Platform galaxy and exported to the MES database using the Entity Model Builder.
- canSchedJobsFromGalaxy
- Optional. Holds a flag that, if true, indicates that the canSchedJobs input parameter was set by a System Platform galaxy export using Entity Model Builder.
- canRunJobsFromGalaxy
- Optional. Holds a flag that, if true, indicates that the canRunJobs input parameter was set by a System Platform galaxy export using Entity Model Builder.
- canCaptureUtilFromGalaxy
- Optional. Holds a flag that, if true, indicates that the canCaptureUtil input parameter was set by a System Platform galaxy export using Entity Model Builder.
- canTrackOeeFromGalaxy
- Optional. Holds a flag that, if true, indicates that the canTrackOee input parameter was set by a System Platform galaxy export using Entity Model Builder.
- canStoreFromGalaxy
- Optional. Holds a flag that, if true, indicates that the canStore input parameter was set by a System Platform galaxy export using Entity Model Builder.
- curShiftId
Optional. Holds the ID of the current shift for this entity. If the can_sched_shifts property for an entity is set to false, then the current shift ID and the current shift datetimes are inherited from the nearest ancestor entity (through preferred ancestor hierarchy) that can schedule shifts; otherwise the current shift ID is set to 0.
Note: This parameter is currently not used.
- curShiftStartTimeLocal
Optional. Holds the date/time of the current shift start time for this entity, in local time. If the can_sched_shifts property for an entity is set to false, then the current shift ID and the current shift datetimes are inherited from the nearest ancestor entity (through preferred ancestor hierarchy) that can schedule shifts; otherwise, the current shift start time is set to the current date and time when the entity is created.
Note: This parameter is currently not used.
- lastDomainChange
Optional. Holds a date/time to identify the last domain change.
Note: This parameter is currently not used.
- treeIcon
Optional. Holds a string that is the key for retrieving the hierarchy tree icon image from the Graphics table. If null, a default image will be used.
Note: This parameter is currently not used.
- flowDiagramImage
Optional. Holds a string that is the key for retrieving the flow diagram image from the Graphics table. If null, a default image will be used.
Note: This parameter is currently not used.
- identicalJobExecs
- Optional. Holds the maximum number of jobs that can be run at the same time on this entity. The default is 0.
- showInDSPTree
Optional. A flag that specifies whether this entity appears in the data source plug-in tree or not.
Note: This parameter is obsolete.
- entClass
- Optional. Holds a flag that, if set to true, specifies that this is an entity class. The default is false.
- spare1
- Optional. Holds user-defined content for the spare1 field. Defaults to null.
- spare2
- Optional. Holds user-defined content for the spare2 field. Defaults to null.
- spare3
- Optional. Holds user-defined content for the spare3 field. Defaults to null.
- spare4
- Optional. Holds user-defined content for the spare4 field. Defaults to null.
- lastEditComment
- Optional. Holds comments about why this record is being added.
- lastEditAt
Output. Holds the returned date/time when this record was created. The lastEditAt parameter is used in other methods that modify or delete this type of record for optimistic concurrency control.
- entId
- Output. Holds the returned entity ID for the new entity.
Observe the following input parameter rules:
- Required non-DB* parameters: Must pass a value. Cannot be empty or null.
- Optional non-DB* parameters: Either enter a value or use the default, if one has been defined for the object being added, by passing a null.
- Required DB* parameters: Must pass a value. To enter an empty value for the parameter, pass DB*.null (e.g., DBInt.null).
- Optional DB* parameters: To enter no value for the parameter, pass DB*.null (e.g., DBInt.null). To use the default value for the parameter if one has been defined for the object being added, pass a null.
If the supplied canCaptureUtil flag for the new entity is set to true, then the corresponding Middleware method validates whether there are enough licenses available for the new entity prior to adding it. If there are enough licenses in the license file, then the corresponding flag is set to true; otherwise, the corresponding flag is set to false.
The following also occurs:
- A new entity ID is generated and a new record with all default data is added to the Grp_Ent_Link table.
- If the parentEntId parameter is not null, then a new record is added to the Ent_Link table.
- If the canSchedJobs flag is set to true, then a new record is added to the Job_Sched_Exec table.
- If the canRunJobs flag is set to true, then a new record is added to the Job_Exec table.
- If the identicalJobExecs parameter is not null and the canRunJobs flag is set to true, then the number of Job_Exec records that are created will equal this value.
- If the canCaptureUtil flag is set to true, then a new record is added to the Util_Exec table.
- If the canCaptureLabor flag is set to true, then a new record is added to the Labor_Exec table.
- If the canTrackOEE flag is set to true, then a new record is added to the Oee_Exec table.
- If the canStore flag is set to true, then a new record is added to the Storage_Exec table.