Skip to main content

CreateEquipmentFromTemplate

Structure

CreateEquipmentFromTemplate(sTemplate, sNewCompany, sNewGageSN, sNewGageID: String; iQuantity: Integer; sDefaultCalType: String; bGetFirstUnusedValue, bDoNotCopyCharges, bDoNotCopyAttributesValues: Boolean): String:

## Type

Function

Description

This event function does the same operation as the 'Add New Equipment From Template...' menu option from above the 'Choose Equipment' grid in an event. The parameters required mirror the options available in the event dialog. Equipment created by this function are automatically added into the Choose Equipment grid in the event.

Parameters

ParameterTypeDescription
sTemplateStringTemplate to be used to create asset(s)
sNewCompanyStringCompany for the new equipment created
sNewGageSNStringI.D. for the new equipment created
sNewGageIDStringSerial Number for the new equipment created (optional)
iQuantityIntegerNumber of assets to be created. The default is 1 (value cannot be 0, must be at least 1.) If more than 1, then the autonumber scheme is used to create sNewID values. The autonumber scheme is found on the template level.
sDefaultCalTypeStringDefault cal. type to be set for the new equipment.
bGetFirstUnusedValueBooleanGet First Unused Value if AutoNumber scheme is used.
bDoNotCopyChargesBooleanDo not copy charges from template to equipment.
bDoNotCopyAttributesValuesBooleanDo not copy attributes values from template to equipment.

Return value

Text. The text will be blank if no errors occurred. If any errors occurred, they will be logged one-error-per-line in the text results.