Update(Int32,Int32,String,DBString,DBInt,DBInt,DBDouble,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,DBInt,DBDateTime,DBDateTime,DBString,DBString,Int32,Boolean,Boolean,DBString,DBString,DBString,DBString,DBString,DateTime) Method
- Last UpdatedMar 17, 2026
- 9 minute read
The Update() method updates all columns for the specified entity record in the Ent table.
'Declaration
Public Overloads Shared Sub Update( _
ByVal sessionId As Integer, _
ByVal entId 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 Boolean, _
ByVal canRunJobs As Boolean, _
ByVal canCaptureUtil As Boolean, _
ByVal canCaptureLabor As Boolean, _
ByVal canDoDNC As Boolean, _
ByVal canTrackOEE As Boolean, _
ByVal canSchedShifts As Boolean, _
ByVal canStore As Boolean, _
ByVal canLogData As Boolean, _
ByVal canShip As Boolean, _
ByVal canReceive As Boolean, _
ByVal canCopyFolders As Boolean, _
ByVal canCaptureQmData As Boolean, _
ByVal entityFromGalaxy As Boolean, _
ByVal canSchedJobsFromGalaxy As Boolean, _
ByVal canRunJobsFromGalaxy As Boolean, _
ByVal canCaptureUtilFromGalaxy As Boolean, _
ByVal canTrackOeeFromGalaxy As Boolean, _
ByVal canStoreFromGalaxy As Boolean, _
ByVal curShiftId As DBInt, _
ByVal curShiftStartTimeLocal As DBDateTime, _
ByVal lastDomainChange As DBDateTime, _
ByVal treeIcon As DBString, _
ByVal flowDiagramImage As DBString, _
ByVal identicalJobExecs As Integer, _
ByVal showInDSPTree As Boolean, _
ByVal entClass As 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 _
)
'Usage
Dim sessionId As Integer
Dim entId 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 Boolean
Dim canRunJobs As Boolean
Dim canCaptureUtil As Boolean
Dim canCaptureLabor As Boolean
Dim canDoDNC As Boolean
Dim canTrackOEE As Boolean
Dim canSchedShifts As Boolean
Dim canStore As Boolean
Dim canLogData As Boolean
Dim canShip As Boolean
Dim canReceive As Boolean
Dim canCopyFolders As Boolean
Dim canCaptureQmData As Boolean
Dim entityFromGalaxy As Boolean
Dim canSchedJobsFromGalaxy As Boolean
Dim canRunJobsFromGalaxy As Boolean
Dim canCaptureUtilFromGalaxy As Boolean
Dim canTrackOeeFromGalaxy As Boolean
Dim canStoreFromGalaxy As Boolean
Dim curShiftId As DBInt
Dim curShiftStartTimeLocal As DBDateTime
Dim lastDomainChange As DBDateTime
Dim treeIcon As DBString
Dim flowDiagramImage As DBString
Dim identicalJobExecs As Integer
Dim showInDSPTree As Boolean
Dim entClass As 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
Ent.Update(sessionId, entId, 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)
public static void Update(
int sessionId,
int entId,
string entName,
DBString description,
DBInt parentEntId,
DBInt site,
DBDouble hourlyCost,
bool canSchedJobs,
bool canRunJobs,
bool canCaptureUtil,
bool canCaptureLabor,
bool canDoDNC,
bool canTrackOEE,
bool canSchedShifts,
bool canStore,
bool canLogData,
bool canShip,
bool canReceive,
bool canCopyFolders,
bool canCaptureQmData,
bool entityFromGalaxy,
bool canSchedJobsFromGalaxy,
bool canRunJobsFromGalaxy,
bool canCaptureUtilFromGalaxy,
bool canTrackOeeFromGalaxy,
bool canStoreFromGalaxy,
DBInt curShiftId,
DBDateTime curShiftStartTimeLocal,
DBDateTime lastDomainChange,
DBString treeIcon,
DBString flowDiagramImage,
int identicalJobExecs,
bool showInDSPTree,
bool entClass,
DBString spare1,
DBString spare2,
DBString spare3,
DBString spare4,
DBString lastEditComment,
ref DateTime lastEditAt
)
Parameters
- sessionId
- Required. Holds the session ID and thus the user who is making this method call.
- entId
- Required. Holds the ID of the entity that is being updated.
- entName
- Required. Holds the new name for the entity.
- description
- Required. Holds the new description for the entity.
- parentEntId
Required. Holds the ID of the new parent entity for this entity. If null, this entity will be a root entity (i.e., at the top level of the entity hierarchy).
If an entity has multiple parents, this is the one from which to inherit things that can only be inherited from one (e.g., the shift schedule).
- site
Required. 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.
Note: The site parameter is always ignored in the Update Entity stored procedure SP_U_ENT.
- hourlyCost
- Required. Holds the new cost of running this entity per hour.
- canSchedJobs
- Required. Holds the updated setting for the flag that, if set to true, specifies that jobs can be scheduled to this entity.
- canRunJobs
- Required. Holds the updated setting for the flag that, if set to true, specifies that jobs can be run on this entity.
- canCaptureUtil
- Required. Holds the updated setting for the flag that, if set to true, specifies that this entity can capture utilization, subject to the number of available licenses.
- canCaptureLabor
- Required. Holds the updated setting for the flag that, if set to true, specifies that this entity can capture labor data.
- canDoDNC
- Required. Holds the updated setting for the flag that, if set to true, specifies that this entity can communicate with machine tools.
- canTrackOEE
- Required. Holds the updated setting for the flag that, if set to true, specifies that this entity can capture OEE statistics.
- canSchedShifts
- Required. Holds the updated setting for the flag that specifies that whether or not this entity can schedule shifts. If true, this entity will have its own shift schedules. Otherwise, the shift schedules are inherited from the entity's preferred parent or from its nearest ancestor that can schedule shifts.
- canStore
- Required. Holds the updated setting for the flag that, if set to true, specifies that this entity can store items, and thus this can be used as a storage location.
- canLogData
- Required. Holds the updated setting for the flag that, if set to true, specifies that this entity can log data.
- canShip
- Required. Holds the updated setting for the flag that, if set to true, specifies that materials can be shipped from this entity.
- canReceive
- Required. Holds the updated setting for the flag that, if set to true, specifies that materials can be received at this entity.
- canCopyFolders
- Required. Holds the updated setting for the flag that, if set to true, specifies that the files in folders for this entity can be copied to its download directories.
- canCaptureQmData
- Required. Holds the updated setting for the flag that, if set to true, specifies that QM data can be captured on this entity.
- entityFromGalaxy
- Required. 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
- Required. 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
- Required. 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
- Required. 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
- Required. 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
- Required. 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
Required. 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 date/times 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
Required. 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 date times 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
Required. Holds the new date/time of the last domain change.
Note: This parameter is currently not used.
- treeIcon
Required. 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
Required. 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
- Required. Holds the maximum number of jobs that can be run at the same time on this entity.
- showInDSPTree
Required. Holds a flag that, if set to true, specifies that this entity will appear in the data source plug-in tree.
Note: This parameter is obsolete.
- entClass
- Required. Holds a flag that, if set to true, specifies that this is an entity class.
- spare1
- Required. Holds new content for the spare1 field.
- spare2
- Required. Holds new content for the spare2 field.
- spare3
- Required. Holds new content for the spare3 field.
- spare4
- Required. Holds new content for the spare4 field.
- lastEditComment
- Required. Holds comments about why this record is being changed.
- lastEditAt
Required. Holds the date/time when this record was added or last edited, for optimistic concurrency control. The passed value must match the lastEditAt value in the record for the update to succeed.
Output. Holds the date/time value when this record was updated by this called method.
Observe the following input parameter rules:
- Required non-DB* parameters: Must pass a value. Cannot be empty or null.
- Required DB* parameters: Must pass a value. To clear the existing value and enter an empty value, pass DB*.null
If the supplied canCaptureUtil flag or canDoDNC 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 updating 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:
- If the canSchedJobs flag is changed to true, then a new record is added to the Job_Sched_Exec table. If the flag is changed to false, then the corresponding Middleware method checks for any jobs scheduled or initiated on the specified entity. If jobs are found and are not completed or cancelled, then an error is raised. If no such jobs are found on the entity, then it deletes the rows (if present) in the Job_Exec, Oper_Ent_Route, Oper_Ent_Spec, Folder_Item_Oper_Ent_Link, and Oper_Ent_Link tables.
- If the canRunJobs flag is changed to true, then a new record is added to the Job_Exec table. If the flag is changed to false, then the corresponding Middleware method checks for any jobs scheduled or initiated on the specified entity. If jobs are found and are not completed or cancelled, then an error is raised. If no such jobs are found on the entity, then it deletes the rows (if present) in the Job_Exec table.
- If the canCaptureUtil flag is changed to true, then a new record is added to the Util_Exec table. If the flag is changed to false, then the entity's corresponding record in the Util_Exec table is removed.
- If the canCaptureLabor flag is changed to true, then a new record is added to the Labor_Exec table. If the flag is changed to false, then the entity's corresponding record in the Labor_Exec table is removed.
- If the canTrackOEE flag is changed to true, then a new record is added to the Oee_Exec table. If the flag is changed to false, then the entity's corresponding record in the Oee_Exec table is removed.
- If the canStore flag is changed to true, then a new record is added to the Storage_Exec table. If the flag is changed to false, then the entity's corresponding record in the Storage_Exec table is removed.
- If the canDoDNC flag is changed to true, then a new record is added to the DNC_EXEC table. If the flag is changed to false, then the entity's corresponding record in the DNC_EXEC table is removed.
If an entity is a member of a line, then its canRunJobs, canCaptureUtil, and canTrackOEE parameters cannot be set to False. If an entity is a member of a line and any of these parameters are set to False, an error message will be returned.