# Customized Panes for 'xxxxxxxx' Created: 2009/04/09
# PANE:List of Currencies
[PANE]
ADMIN INVPENLZ 01000List of Currencies 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 & ""
' 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, TheCurrency
CustomizedPane.CodeObject.ListviewData = " "
' Populate the Stockcode variable with the refresh value
TheCurrency = CustomizedPane.CodeObject.RefreshValue
if TheCurrency = "" then
exit function
end if
' Build the XML input to the business object
XMLParam = XMLParam & ""
XMLParam = XMLParam & " "
XMLParam = XMLParam & " TblCurrency"
XMLParam = XMLParam & " "
XMLParam = XMLParam & " Currency"
XMLParam = XMLParam & " "
XMLParam = XMLParam & " "
XMLParam = XMLParam & " Description"
XMLParam = XMLParam & " "
XMLParam = XMLParam & " "
XMLParam = XMLParam & " BuyExchangeRate"
XMLParam = XMLParam & " "
XMLParam = XMLParam & " "
XMLParam = XMLParam & " BuyMulDiv"
XMLParam = XMLParam & " "
XMLParam = XMLParam & " "
XMLParam = XMLParam & " SellExchangeRate"
XMLParam = XMLParam & " "
XMLParam = XMLParam & " "
XMLParam = XMLParam & " SellMulDiv"
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("COMBRW",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 elements are all one level down, so was not available to be used
' in the listview
Dim NewXML, NewXMLE, xDoc, xList, xList2, Counter, Counter2
Dim CIB, CIE, CurB, CurE, CDB, CDE, BERB, BERE, BMDB, BMDE, SERB, SERE, SMDB, SMDE, CurrItems
Dim LocB, LocE, LotB, LotE, SFB, SFE, LFB, LFE, SDFB, SDFE, QOHB, QOHE, QAB, QAE, QRB, QRE, QITB, QITE
Dim EDB, EDE, SDTB, SDTE, DDB, DDE, SMB, SME, XMLDoc
NewXML = ""
NewXMLE = ""
CIB = ""
CIE = ""
CurB = ""
CurE = ""
CDB = ""
CDE = ""
BERB = ""
BERE = ""
BMDB = ""
BMDE = ""
SERB = ""
SERE = ""
SMDB = ""
SMDE = ""
' 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("//Row")
' Loop through each of the WarehouseItem elements
For Counter = 0 To xList.length - 1
CurrItems = ""
' Build the new XML containing the original content of the SerialItem nodes and
' include the Warehouse from several levels above.
NewXML = NewXML & CIB
NewXML = NewXML & CurB & xList(Counter).SelectSingleNode("Currency/Value").Text & CurE
NewXML = NewXML & CDB & xList(Counter).SelectSingleNode("Description/Value").Text & CDE
NewXML = NewXML & BERB & xList(Counter).SelectSingleNode("BuyExchangeRate/Value").Text & BERE
NewXML = NewXML & BMDB & xList(Counter).SelectSingleNode("BuyMulDiv/Value").Text & BMDE
NewXML = NewXML & SERB & xList(Counter).SelectSingleNode("SellExchangeRate/Value").Text & SERE
NewXML = NewXML & SMDB & xList(Counter).SelectSingleNode("SellMulDiv/Value").Text & SMDE
NewXML = NewXML & CIE
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