AddWithGUID Method (IPISubBatches2 interface)

             

Creates and adds a PISubBatch object to the collection with an optional passed GUID. The PISubBatch is returned.

 

Syntax

object.AddWithGUID Name, Heading, varStartTime, [varEndTime], [varGUID]

The AddWithGUID method syntax has these parts:

Part Description
object An object expression that evaluates to a PISubBatches collection.
Name String representing the Name of the PISubBatch; for example, “Heat”.
Heading PIHeading of the PISubBatch. Must be a defined PIHeading. The definition is used to set the type of sub-batch; such as phase.
varStartTime VARIANT representing the start time of the PISubBatch. The VARIANT may be a PITime, DATE, String, or numeric. Interpretation of DATE, strings and numerics is consistent with PITime's interpretation.
varEndTime Optional VARIANT representing the end time of the PISubBatch. The VARIANT may be a PITime, DATE, String, or numeric. Interpretation of DATE, strings and numerics is consistent with PITime's interpretation. Normally a PISubBatch is created at the start of the sub-batch therefore the end time is not known.
varGUID Optional VARIANT for the GUID for to the PISubBatch being added.

 

Remarks

WARNING: Using this interface improperly can cause data corruption on the Server. The GUID passed must not be the same as any other GUID used by the Server

 

Here are two Windows methods for properly creating a GUID:

CoCreateGuid (COM: unmanaged code)

System.Guid class (.NET)

 

The Name does not have to be unique within the collection. Each PISubBatch is assigned a UniqueID, unless one is passed in. If a GUID was passed, the object will have that GUID for its UniqueID

 

If a GUID is not passed in, this call will fail if the computer doesn't have a network card or if the computer is a laptop running Windows NT4 and is not connected to the network (i.e. the network card has not been initialized).

Trappable Errors

In addition to generic errors (such as Out of Memory), the following errors may occur:
Error Description
pseNOGENSERVER The underlying server abstraction layer could not be accessed.

Enabling Operational Intelligence