Add Method (WoFile)
- Last UpdatedNov 06, 2025
- 3 minute read
The Add() method adds a new work order file record to the Wo_File table.
'Declaration
Public Shared Sub Add( _
ByVal sessionId As Integer, _
ByVal woId As String, _
ByVal filePath As String, _
ByVal fileDesc As String, _
ByVal fileType As String, _
ByVal lastModified As Nullable(Of Date), _
ByVal fileSize As Nullable(Of Integer), _
ByVal author As String, _
ByVal spare1 As String, _
ByVal spare2 As String, _
ByVal spare3 As String, _
ByVal spare4 As String, _
ByVal lastEditComment As String, _
ByRef modId As String _
)
'Usage
Dim sessionId As Integer
Dim woId As String
Dim filePath As String
Dim fileDesc As String
Dim fileType As String
Dim lastModified As Nullable(Of Date)
Dim fileSize As Nullable(Of Integer)
Dim author As String
Dim spare1 As String
Dim spare2 As String
Dim spare3 As String
Dim spare4 As String
Dim lastEditComment As String
Dim modId As String
WoFile.Add(sessionId, woId, filePath, fileDesc, fileType, lastModified, fileSize, author, spare1, spare2, spare3, spare4, lastEditComment, modId)
public static void Add(
int sessionId,
string woId,
string filePath,
string fileDesc,
string fileType,
Nullable<DateTime> lastModified,
Nullable<int> fileSize,
string author,
string spare1,
string spare2,
string spare3,
string spare4,
string lastEditComment,
out string modId
)
Parameters
- sessionId
- Required. Holds the session ID and thus the user who is making this method call.
- woId
- Required. Holds the ID of the work order to which the file belongs.
- filePath
- Required. Holds the path and file name of the file associated with the work order.
- fileDesc
- Optional. Holds the description of the file.
- fileType
- Optional. This parameter is ignored. The file_type column in the WO_File table is obsolete. For the file_type column in WoFile.GetAll() and GetByKey() returned datasets, the file extension from the filename in the file_path column will be returned.
- lastModified
- Optional. Holds the date/time of the last time the file was modified.
- fileSize
- Optional. Holds the size of the file in bytes.
- author
- Optional. Holds the name of the author of the file.
- spare1
- Optional. Holds the contents of the user-defined spare1 field.
- spare2
- Optional. Holds the contents of the user-defined spare2 field.
- spare3
- Optional. Holds the contents of the user-defined spare3 field.
- spare4
- Optional. Holds the contents of the user-defined spare4 field.
- lastEditComment
- Optional. Holds comments that describe why this record is being added.
- modId
- Output. Holds the modification ID assigned to this record when it is added. The modId parameter is used by other methods that modify or delete this type of record for optimistic concurrency control.
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 pass a null. If passing a null and a default value has been defined, the default value will be used for the parameter.
- 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.