Label.Name
This property returns/sets the name of this Label.
SVB Example
Data Entry Example 1: Adding labels for data entry:
Sub Main
'Note, run the examples "Adding a user" and "Adding a folder"
'before running this example.
Dim oOM As ObjectManager
'Reconnect into Enterprise
Set oOM = New ObjectManager
oOM.Reconnect Application
'SAMPLE LABEL
'Set up info for a sample label, in this case the bakery
Dim bakeryInfo As New LabelCreateInfo
bakeryInfo.AuditLogReason = "Adding Bakeries Label"
bakeryInfo.Name = "Bakeries"
bakeryInfo.Folder = "/Blake's Materials"
'Add the Label to the system
Dim Bakery As Label
Set Bakery = oOM.Labels.AddEx(bakeryInfo)
Bakery.AutoSave = False
'Actually add the bakeries to it
Bakery.Type = swcSample
Bakery.ListType = swcLabelListType_Static 'user will have list of items to choose from
Bakery.Description = "List of bakeries in local area"
Bakery.LabelValueList.Add("Kettering")
Bakery.LabelValueList.Add("Vandalia")
Bakery.LabelValueList.Add("Huber Heights")
Bakery.LabelValueList.Add("Oakwood")
'Commit our changes
Dim bakeryUpdateInfo As New LabelUpdateInfo
bakeryUpdateInfo.AuditLogReason = "Adding the bakeries to the list"
Bakery.SaveEx(bakeryUpdateInfo)
'PIECE LABEL
'Now, we will set up piece-wise label, in this case the baker
'who created the piece (loaf of bread) being measured
Dim bakerInfo As New LabelCreateInfo
bakerInfo.AuditLogReason = "Adding Bakers Label"
bakerInfo.Name = "Bakers"
bakerInfo.Folder = "/Blake's Materials"
'Add the Label to the system
Dim Baker As Label
Set Baker = oOM.Labels.AddEx(bakerInfo)
Baker.AutoSave = False
'Add the bakers
Baker.Type = swcPiece
Baker.ListType = swcLabelListType_Static
Baker.SampleSize = 5 'User will enter 5 pieces (loaves) per sample (bakery)
Baker.Description = "List of bakers employed by the bakeries"
'Vandalia
Baker.LabelValueList.Add("Blake")
Baker.LabelValueList.Add("Gabi")
Baker.LabelValueList.Add("Nancy")
Baker.LabelValueList.Add("Isabelle")
Baker.LabelValueList.Add("Maddie")
'Huber Heights
Baker.LabelValueList.Add("Angel")
Baker.LabelValueList.Add("Salem")
Baker.LabelValueList.Add("Luna")
Baker.LabelValueList.Add("Mizzie")
Baker.LabelValueList.Add("Cotton")
'Kettering
Baker.LabelValueList.Add("Max")
Baker.LabelValueList.Add("Morgan")
Baker.LabelValueList.Add("Toby")
Baker.LabelValueList.Add("Austin")
Baker.LabelValueList.Add("Paula")
'Commit our changes
Dim bakerUpdateInfo As New LabelUpdateInfo
bakerUpdateInfo.AuditLogReason = "Adding the bakers to the list"
Baker.SaveEx(bakerUpdateInfo)
'We will add cause and action labels, which the user
'will be prompted for during Quality Control (if a run violation happens).
'CAUSE LABEL
'Now, we will set up the cause labels, in this case an
'explanation for what caused an unacceptable mixture
Dim causeInfo As New LabelCreateInfo
causeInfo.AuditLogReason = "Adding cause label"
causeInfo.Name = "Bad Mixture Causes"
causeInfo.Folder = "/Blake's Materials"
'Add the Label to the system
Dim causeLabel As Label
Set causeLabel = oOM.Labels.AddEx(causeInfo)
causeLabel.AutoSave = False
causeLabel.AllowForDataEntry = False
causeLabel.Type = swcCause
causeLabel.Description = "Explanations for bad bread mixtures"
causeLabel.LabelValueList.Add("Not enough ingredient(s) available")
causeLabel.LabelValueList.Add("Baker measuring error")
causeLabel.LabelValueList.Add("Measuring cups not available")
'Commit our changes
Dim causeLabelUpdateInfo As New LabelUpdateInfo
causeLabelUpdateInfo.AuditLogReason = "Adding the cause labels"
causeLabel.SaveEx(causeLabelUpdateInfo)
'ACTION LABEL
'Now, we will set up the action labels, in this case
'actions for how to deal with an unacceptable mixture
Dim actionInfo As New LabelCreateInfo
actionInfo.AuditLogReason = "Adding action label"
actionInfo.Name = "Bad Mixture Actions"
actionInfo.Folder = "/Blake's Materials"
'Add the Label to the system
Dim actionLabel As Label
Set actionLabel = oOM.Labels.AddEx(actionInfo)
actionLabel.AutoSave = False
actionLabel.AllowForDataEntry = False
actionLabel.Type = swcAction
actionLabel.Description = "Actions for bad bread mixtures"
actionLabel.LabelValueList.Add("Terminate baker")
actionLabel.LabelValueList.Add("Reorder ingredients")
actionLabel.LabelValueList.Add("Reorder measuring cups")
'Commit our changes
Dim actionLabelUpdateInfo As New LabelUpdateInfo
actionLabelUpdateInfo.AuditLogReason = "Adding the action labels"
actionLabel.SaveEx(actionLabelUpdateInfo)
oOM.Disconnect
End Sub
Copyright © 2020. Cloud Software Group, Inc. All Rights Reserved.
