Advertisement
Guest User

Untitled

a guest
Apr 27th, 2015
197
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Function createTempItem(itemID As String, newDoc As NotesDocument)
  2.    
  3.     On Error GoTo logError
  4.  
  5.     Dim session As New NotesSession
  6.     Dim db As NotesDatabase
  7.     Set db = session.currentDatabase
  8.    
  9.     Dim doc As NotesDocument
  10.     Set doc = db.createDocument
  11.    
  12.     doc.form = "item"
  13.     doc.shortDescription = newDoc.shortDescription(0)
  14. '   doc.itemType = "Client Materials"
  15.     doc.itemType = newDoc.itemType(0)
  16.     doc.exhibitorName = newDoc.exhibitorName(0)
  17.     doc.exhibitorID = newDoc.exhibitorID(0)
  18.    
  19.     doc.Length = newDoc.length(0)
  20.     doc.Width = newDoc.width(0)
  21.     doc.Height = newDoc.height(0)
  22.     doc.Weight = newDoc.weight(0)
  23.     doc.addinfo = newDoc.addInfo(0)
  24.    
  25.    
  26.     Dim l As Double
  27.     Dim w As Double
  28.     Dim h As Double
  29.    
  30.     If IsNumeric(newDoc.length(0)) Then
  31.         l = newDoc.length(0)
  32.     Else
  33.         l = 0
  34.     End If
  35.    
  36.     If IsNumeric(newDoc.width(0)) Then
  37.         w = newdoc.width(0)
  38.     Else
  39.         w = 0
  40.     End If
  41.    
  42.     If IsNumeric(newDoc.Height(0)) Then
  43.         h = newDoc.height(0)
  44.     Else
  45.         h = 0
  46.     End If
  47.    
  48.     doc.cube = calculateCube(l, w, h)
  49.     doc.itemID = itemID
  50.    
  51.     doc.createdDate = Now()
  52.     doc.createdBy = session.Username
  53.    
  54.     doc.jobcode = newdoc.jobCode(0)
  55.    
  56.     If newDoc.manifestType(0) = "Shipping" Then
  57.         doc.manifestNumber = newDoc.manifestnumber(0)
  58.     Else
  59.         doc.rManifestNumber = newDoc.rManifestnumber(0)
  60.     End If
  61.    
  62.    
  63.     doc.tempItem = "Y"
  64.    
  65.     Dim bCode As string
  66.     bcode = newdoc.itemID(0)
  67.     doc.barcode = "*" + bcode + "*"
  68.     doc.barcodeHuman = bcode
  69.    
  70.     ' add facility information
  71.     Dim facility As NotesDocument
  72.     Set facility = getFacilityDoc(newdoc.facility(0))
  73.    
  74.     If facility Is Nothing Then
  75.         Call logEvent("Facility : " + newdoc.facility(0) + " not found", 0, Nothing)
  76.     Else
  77.         doc.currentUnique = facility.unique(0)
  78.         doc.czarLocation = facility.czarLocation(0)
  79.        
  80.         doc.czarCity = facility.name(0)
  81.         doc.czarBuilding = facility.buildingCode(0)
  82.         doc.czarUnique = facility.unique(0)
  83.        
  84.        
  85.     End If
  86.    
  87.     doc.status = "In"
  88.    
  89.    
  90.     doc.currentLocation = newDoc.facility(0)
  91.  
  92.    
  93.    
  94.     Call doc.save(True, True)
  95.  
  96.  
  97. getOut:
  98.     Exit Function
  99.  
  100. logError:
  101.     MsgBox logError()
  102.     End
  103.    
  104. End Function
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement