Add(Int32,String,String,String,String,String,String,String,String,String,String,String,Boolean,Boolean,String,String,String,String,DateTime) Method
- Last UpdatedNov 06, 2025
- 3 minute read
The Add() method adds a new customer or vendor record to the Cust table.
This overload of the method includes the lastEditAt input parameter.
'Declaration
Public Overloads Shared Sub Add( _
ByVal sessionId As Integer, _
ByVal custId As String, _
ByVal custName As String, _
ByVal address1 As String, _
ByVal address2 As String, _
ByVal city As String, _
ByVal state As String, _
ByVal zip As String, _
ByVal country As String, _
ByVal phone As String, _
ByVal fax As String, _
ByVal email As String, _
ByVal customer As Boolean, _
ByVal vendor As Boolean, _
ByVal spare1 As String, _
ByVal spare2 As String, _
ByVal spare3 As String, _
ByVal spare4 As String, _
ByRef lastEditAt As Date _
)
'Usage
Dim sessionId As Integer
Dim custId As String
Dim custName As String
Dim address1 As String
Dim address2 As String
Dim city As String
Dim state As String
Dim zip As String
Dim country As String
Dim phone As String
Dim fax As String
Dim email As String
Dim customer As Boolean
Dim vendor As Boolean
Dim spare1 As String
Dim spare2 As String
Dim spare3 As String
Dim spare4 As String
Dim lastEditAt As Date
Cust.Add(sessionId, custId, custName, address1, address2, city, state, zip, country, phone, fax, email, customer, vendor, spare1, spare2, spare3, spare4, lastEditAt)
public static void Add(
int sessionId,
string custId,
string custName,
string address1,
string address2,
string city,
string state,
string zip,
string country,
string phone,
string fax,
string email,
bool customer,
bool vendor,
string spare1,
string spare2,
string spare3,
string spare4,
out DateTime lastEditAt
)
Parameters
- sessionId
- Required. Holds the session ID and thus the user who is making this method call.
- custId
- Required. Holds the customer or vendor ID.
- custName
- Required. Holds the name of the customer or vendor.
- address1
- Required. Holds the street address of the customer or vendor.
- address2
- Optional. Holds an extra line for a street address.
- city
- Required. Holds the city portion of the address.
- state
- Optional. Holds the state portion of the address.
- zip
- Optional. Holds the ZIP code portion of the address.
- country
- Optional. Holds the country portion of the address.
- phone
- Optional. Holds the phone number of the customer or vendor.
- fax
- Optional. Holds the fax number of the customer or vendor.
- Optional. Holds the email address of the customer or vendor.
- customer
Required. Holds a flag that, if true, indicates that this is a customer.
If you both buy from and sell to this firm, then both the customer and vendor flags can be true to indicate this.
- vendor
- Required. Holds a flag that, if true, indicates that this is a vendor.
- 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.
- lastEditAt
- Output. Holds the returned date and time when this record was added. The lastEditAt parameter is used by other methods that modify or delete this type of record for optimistic concurrency control.
Both the customer and vendor flags can be set to false to indicate that this company is no longer active.
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.