# Customized Panes for 'xxxxxxxx' Created: 2009/04/09 # PANE:Actual Costs (Lots) [PANE] ADMIN INVPENLZ 01000Actual Costs (Lots) 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 & "" ' 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, FIB, FIE, BucB, BucE, WHB, WHE, UCB, UCE Dim QOHB, QOHE, LRDB, LRDE, LIDB, LIDE, LotItems, XMLDoc, FLB, FLE NewXML = "" NewXMLE = "" FIB = "" FIE = "" BucB = "" BucE = "" FLB = "" FLE = "" UCB = "" UCE = "" QOHB = "" QOHE = "" LRDB = "" LRDE = "" LIDB = "" LIDE = "" WHB = "" WHE = "" ' 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 SerialItem elements Set xList2 = xList(Counter).SelectNodes("FifoDetails/FifoItem") ' 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 & FIB NewXML = NewXML & BucB & xList2(Counter2).SelectSingleNode("Bucket").Text & BucE NewXML = NewXML & FLB & xList2(Counter2).SelectSingleNode("FifoLot").Text & FLE NewXML = NewXML & WHB & xList(Counter).SelectSingleNode("Warehouse").Text & WHE NewXML = NewXML & UCB & xList2(Counter2).SelectSingleNode("UnitCost").Text & UCE NewXML = NewXML & QOHB & xList2(Counter2).SelectSingleNode("QtyOnHand").Text & QOHE NewXML = NewXML & LRDB & xList2(Counter2).SelectSingleNode("LastReceiptDate").Text & LRDE NewXML = NewXML & LIDB & xList2(Counter2).SelectSingleNode("LastIssueDate").Text & LIDE NewXML = NewXML & FIE 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