Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Function createTempItem(itemID As String, newDoc As NotesDocument)
- On Error GoTo logError
- Dim session As New NotesSession
- Dim db As NotesDatabase
- Set db = session.currentDatabase
- Dim doc As NotesDocument
- Set doc = db.createDocument
- doc.form = "item"
- doc.shortDescription = newDoc.shortDescription(0)
- ' doc.itemType = "Client Materials"
- doc.itemType = newDoc.itemType(0)
- doc.exhibitorName = newDoc.exhibitorName(0)
- doc.exhibitorID = newDoc.exhibitorID(0)
- doc.Length = newDoc.length(0)
- doc.Width = newDoc.width(0)
- doc.Height = newDoc.height(0)
- doc.Weight = newDoc.weight(0)
- doc.addinfo = newDoc.addInfo(0)
- Dim l As Double
- Dim w As Double
- Dim h As Double
- If IsNumeric(newDoc.length(0)) Then
- l = newDoc.length(0)
- Else
- l = 0
- End If
- If IsNumeric(newDoc.width(0)) Then
- w = newdoc.width(0)
- Else
- w = 0
- End If
- If IsNumeric(newDoc.Height(0)) Then
- h = newDoc.height(0)
- Else
- h = 0
- End If
- doc.cube = calculateCube(l, w, h)
- doc.itemID = itemID
- doc.createdDate = Now()
- doc.createdBy = session.Username
- doc.jobcode = newdoc.jobCode(0)
- If newDoc.manifestType(0) = "Shipping" Then
- doc.manifestNumber = newDoc.manifestnumber(0)
- Else
- doc.rManifestNumber = newDoc.rManifestnumber(0)
- End If
- doc.tempItem = "Y"
- Dim bCode As string
- bcode = newdoc.itemID(0)
- doc.barcode = "*" + bcode + "*"
- doc.barcodeHuman = bcode
- ' add facility information
- Dim facility As NotesDocument
- Set facility = getFacilityDoc(newdoc.facility(0))
- If facility Is Nothing Then
- Call logEvent("Facility : " + newdoc.facility(0) + " not found", 0, Nothing)
- Else
- doc.currentUnique = facility.unique(0)
- doc.czarLocation = facility.czarLocation(0)
- doc.czarCity = facility.name(0)
- doc.czarBuilding = facility.buildingCode(0)
- doc.czarUnique = facility.unique(0)
- End If
- doc.status = "In"
- doc.currentLocation = newDoc.facility(0)
- Call doc.save(True, True)
- getOut:
- Exit Function
- logError:
- MsgBox logError()
- End
- End Function
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement