# Customized Panes for 'xxxxxxxx' Created: 2009/04/09
# PANE:In Inspection
[PANE]
ADMIN INVPENLZ 01000In Inspection 020 000000500000INVPEN000M
[VBSCRIPT]
' This script contains functions for customized pane events.
' You must not modify the name of the functions.
Option Explicit
Function CustomizedPane_OnLoad()
' Define the variable to hold the XML that defines the listview structure
dim ListXML
' Build the XML that defines the listview structure. Those items containing the
' attribute Hidden=true will not appear.
ListXML = ListXML & ""
ListXML = ListXML & ""
ListXML = ListXML & ""
ListXML = ListXML & ""
ListXML = ListXML & ""
ListXML = ListXML & ""
ListXML = ListXML & ""
ListXML = ListXML & ""
ListXML = ListXML & ""
ListXML = ListXML & ""
ListXML = ListXML & ""
ListXML = ListXML & ""
ListXML = ListXML & ""
ListXML = ListXML & ""
ListXML = ListXML & ""
ListXML = ListXML & ""
ListXML = ListXML & ""
ListXML = ListXML & ""
'Hidden='true'
' Load the XML in to the ListviewProperties variable
CustomizedPane.CodeObject.ListviewProperties = ListXML
End Function
Function CustomizedPane_OnRefresh()
' Define the variables required for building the XML and calling the business object
dim XMLOut, XMLParam, Stockcode
CustomizedPane.CodeObject.ListviewData = " "
' Populate the Stockcode variable with the refresh value
Stockcode = CustomizedPane.CodeObject.RefreshValue
if Stockcode = "" then
exit function
end if
' Build the XML input to the business object
XMLParam = XMLParam & " "
XMLParam = XMLParam & " "
XMLParam = XMLParam & " "
XMLParam = XMLParam & " "
XMLParam = XMLParam & " "
XMLParam = XMLParam & " "
on error resume next
' Call the business object and supply the XML. The resulting XML is placed in the XMLOut variable
XMLOut = CallBO("INVQWR",XMLParam,"auto")
if err then
exit function
end if
' Switch on error handling
on error goto 0
' Define the variables required for building the new XML structure and extracting the information from
' the DOM. This is required because the Warehouse element is held at a different level in the original
' XML, so was not available to be used in the listview
Dim NewXML, NewXMLE, xDoc, xList, xList2, Counter, Counter2, GIB, GIE, GRNB, GRNE, GRDB, GRDE, WHB, WHE, POB, POE
Dim POLB, POLE, INB, INE, CCB, CCE, ICB, ICE, GOHB, GOHE, QAB, QAE, QOB, QOE, QIB, QIE, QCB, QCE, QAcB, QAcE
Dim QSB, QSE, QRB, QRE, SupB, SupE, ListXML, LotItems, XMLDoc
NewXML = ""
NewXMLE = ""
GIB = ""
GIE = ""
GRNB = ""
GRNE = ""
GRDB = ""
GRDE = ""
POB = ""
POE = ""
POLB = ""
POLE = ""
INB = ""
INE = ""
CCB = ""
CCE = ""
WHB = ""
WHE = ""
ICB = ""
ICE = ""
GOHB = ""
GOHE = ""
QAB = ""
QAE = ""
QOB = ""
QOE = ""
QIB = ""
QIE = ""
QCB = ""
QCE = ""
QAcB = ""
QAcE = ""
QSB = ""
QSE = ""
QRB = ""
QRE = ""
SupB = ""
SupE = ""
ListXML = ListXML & ""
' Load the output from the business object in to the DOM
Set XMLDoc = createobject("MSXML2.DOMDocument")
XMLDoc.async = false
XMLDoc.LoadXML(XMLOut)
' Look for all WarehouseItem elements
Set xList = XMLDoc.SelectNodes("//WarehouseItem")
' Loop through each of the WarehouseItem elements
For Counter = 0 To xList.length - 1
LotItems = ""
' Within the WarehouseItem elements, locate the GrnItem elements
Set xList2 = xList(Counter).SelectNodes("GrnDetails/GrnItem")
' Loop through each SerialItem section
For Counter2 = 0 To xList2.length- 1
' Build the new XML containing the original content of the SerialItem nodes and
' include the Warehouse from several levels above.
NewXML = NewXML & GIB
NewXML = NewXML & GRNB & xList2(Counter2).SelectSingleNode("Grn").Text & GRNE
NewXML = NewXML & GRDB & xList2(Counter2).SelectSingleNode("GrnReceiptDate").Text & GRDE
NewXML = NewXML & WHB & xList(Counter).SelectSingleNode("Warehouse").Text & WHE
NewXML = NewXML & POB & xList2(Counter2).SelectSingleNode("PurchaseOrder").Text & POE
NewXML = NewXML & POLB & xList2(Counter2).SelectSingleNode("PurchaseOrderLin").Text & POLE
NewXML = NewXML & SupB & xList2(Counter2).SelectSingleNode("Supplier").Text & SupE
NewXML = NewXML & INB & xList2(Counter2).SelectSingleNode("InspNarration").Text & INE
NewXML = NewXML & CCB & xList2(Counter2).SelectSingleNode("CountCompleted").Text & CCE
NewXML = NewXML & ICB & xList2(Counter2).SelectSingleNode("InspectCompleted").Text & ICE
NewXML = NewXML & GOHB & xList2(Counter2).SelectSingleNode("GrnOnHold").Text & GOHE
NewXML = NewXML & QAB & xList2(Counter2).SelectSingleNode("QtyAdvised").Text & QAE
NewXML = NewXML & QOB & xList2(Counter2).SelectSingleNode("QtyOffSite").Text & QOE
NewXML = NewXML & QIB & xList2(Counter2).SelectSingleNode("QtyInspected").Text & QIE
NewXML = NewXML & QCB & xList2(Counter2).SelectSingleNode("QtyCounted").Text & QCE
NewXML = NewXML & QAcB & xList2(Counter2).SelectSingleNode("QtyAccepted").Text & QAcE
NewXML = NewXML & QSB & xList2(Counter2).SelectSingleNode("QtyScrapped").Text & QSE
NewXML = NewXML & QRB & xList2(Counter2).SelectSingleNode("QtyRejected").Text & QRE
NewXML = NewXML & GIE
Next
Next
' Complete the XML by closing off the root element
NewXML = NewXML & NewXMLE
' Load the new XML file in to the ListviewData variable
CustomizedPane.CodeObject.ListviewData = NewXML
End Function