# Customized Panes for 'xxxxxxxx' Created: 2009/04/09 # PANE:Requisition Details (incl routes) [PANE] ADMIN INVPENLZ 01000Requisition Details (incl routes) 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 ' Populate the XML that defines the listview structure 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() ' Specify the variables that will be used when calling the business object dim XMLOut, XMLParam, Requisition CustomizedPane.CodeObject.ListviewData = " " ' Populate the Stockcode variable with the refresh value Requisition = CustomizedPane.CodeObject.RefreshValue if Requisition = "" then exit function end if ' Build up the XML to be passed 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("PORQ91",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, RDB, RDE, LB, LE, SCB, SCE, SDB, SDE Dim WHB, WHE, OQB, OQE, OUB, OUE, ORB, ORE, ONB, ONE, CHB, CHE, CHNB, CHNE, DRRB, DRRE, DDB, DDE Dim RB, RE, FUB, FUE, FUNB, FUNE, TUCB, TUCE, TUNB, TUNE, RNB, RNE, CDB, CDE, PB, PE, CUB, CUE Dim NVB, NVE, RSB, RSE, RSDB, RSDE, ROHB, ROHE, RFRB, RFRE, SUPB, SUPE, SNB, SNE, SOHB, SOHE Dim SCNB, SCNE, CUSB, CUSE, CNE, CNB, CPOB, CPOE, PCB, PCE, PCDB, PCDE, CPONB, CPONE, CPOLB,CPOLE Dim JOBB, JOBE, XMLDoc, UseIncase1, CDATAStr, CDATAStp CDATAStr = "" NewXML = "" NewXMLE = "" RDB = "" RDE = "" LB = "" LE = "" SCB = "" & CDATAStr SCE = CDATAStp & "" SDB = "" & CDATAStr SDE = CDATAStp & "" WHB = "" WHE = "" OQB = "" OQE = "" OUB = "" OUE = "" ORB = "" ORE = "" ONB = "" & CDATAStr ONE = CDATAStp & "" CHB = "" & CDATAStr CHE = CDATAStp & "" CHNB = "" & CDATAStr CHNE = CDATAStp & "" DRRB = "" DRRE = "" DDB = "" DDE = "" RB = "" RE = "" FUB = "" & CDATAStr FUE = CDATAStp & "" FUNB = "" & CDATAStr FUNE = CDATAStp & "" TUCB = "" & CDATAStr TUCE = CDATAStp & "" TUNB = "" & CDATAStr TUNE = CDATAStp & "" RNB = " " & CDATAStr RNE = CDATAStp & "" CDB = "" CDE = "" PB = "" PE = "" CUB = "" CUE = "" NVB = "" NVE = "" RSB = "" RSE = "" RSDB = "" & CDATAStr RSDE = CDATAStp & "" ROHB = "" ROHE = "" RFRB = "" & CDATAStr RFRE = CDATAStp & "" SUPB = "" SUPE = "" SNB = "" & CDATAStr SNE = CDATAStp & "" SOHB = "" SOHE = "" SCNB = "" SCNE = "" CUSB = "" CUSE = "" CNB = "" & CDATAStr CNE = CDATAStp & "" CPOB = "" & CDATAStr CPOE = CDATAStp & "" PCB = "" PCE = "" PCDB = "" & CDATAStr PCDE = CDATAStp & "" CPONB = "" CPONE = "" CPOLB = "" CPOLE = "" JOBB = "" JOBE = "" ' 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("//RequisitionDetail") ' Loop through each of the RequisitionDetail elements For Counter = 0 To xList.length - 1 ' Within the RequisitionDetail elements, locate the RoutingInfo/RouteDetails elements Set xList2 = xList(Counter).SelectNodes("RoutingInfo/RouteDetails") ' 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 & RDB NewXML = NewXML & LB & xList(Counter).SelectSingleNode("Line").Text & LE NewXML = NewXML & SCB & xList(Counter).SelectSingleNode("StockCode").Text & SCE NewXML = NewXML & SDB & xList(Counter).SelectSingleNode("StockDescription").Text & SDE NewXML = NewXML & WHB & xList(Counter).SelectSingleNode("Warehouse").Text & WHE NewXML = NewXML & OQB & xList(Counter).SelectSingleNode("OrderQty").Text & OQE NewXML = NewXML & OUB & xList(Counter).SelectSingleNode("OrderUom").Text & OUE NewXML = NewXML & ORB & xList(Counter).SelectSingleNode("Originator").Text & ORE NewXML = NewXML & ONB & xList(Counter).SelectSingleNode("OriginatorName").Text & ONE NewXML = NewXML & CHB & xList(Counter).SelectSingleNode("CurrentHolder").Text & CHE NewXML = NewXML & CHNB & xList(Counter).SelectSingleNode("CurrentHolderName").Text & CHNE NewXML = NewXML & DRRB & xList(Counter).SelectSingleNode("DateReqnRaised").Text & DRRE NewXML = NewXML & DDB & xList(Counter).SelectSingleNode("DueDate").Text & DDE NewXML = NewXML & RB & xList2(Counter2).SelectSingleNode("Route").Text & RE NewXML = NewXML & FUB & xList2(Counter2).SelectSingleNode("FromUser").Text & FUE NewXML = NewXML & FUNB & xList2(Counter2).SelectSingleNode("FromUserName").Text & FUNE NewXML = NewXML & TUCB & xList2(Counter2).SelectSingleNode("ToUserCode").Text & TUCE NewXML = NewXML & TUNB & xList2(Counter2).SelectSingleNode("ToUserName").Text & TUNE NewXML = NewXML & RNB & xList2(Counter2).SelectSingleNode("RouteNarrative").Text & RNE NewXML = NewXML & CDB & xList2(Counter2).SelectSingleNode("CreationDate").Text & CDE NewXML = NewXML & PB & xList(Counter).SelectSingleNode("Price").Text & PE NewXML = NewXML & CUB & xList(Counter).SelectSingleNode("Currency").Text & CUE NewXML = NewXML & NVB & xList(Counter).SelectSingleNode("NetValue").Text & NVE UseIncase1 = xlist(counter).SelectSingleNode("ReqnStatus").Text Select Case UseIncase1 Case "P" NewXML = NewXML & RSB & "Confirmed in to a P/O" & RSE Case "R" NewXML = NewXML & RSB & "Approved and ready to be confirmed to a P/O" & RSE Case "*" NewXML = NewXML & RSB & "Cancelled" & RSE Case Else NewXML = NewXML & RSB & "Normal" & RSE End select NewXML = NewXML & ROHB & xList(Counter).SelectSingleNode("ReqnOnHoldFlag").Text & ROHE NewXML = NewXML & RFRB & xList(Counter).SelectSingleNode("ReasonForReqn").Text & RFRE NewXML = NewXML & SUPB & xList(Counter).SelectSingleNode("Supplier").Text & SUPE NewXML = NewXML & SNB & xList(Counter).SelectSingleNode("SupplierName").Text & SNE NewXML = NewXML & SOHB & xList(Counter).SelectSingleNode("SupplierOnHold").Text & SOHE NewXML = NewXML & SCNB & xList(Counter).SelectSingleNode("SupCatalogueNum").Text & SCNE NewXML = NewXML & CUSB & xList(Counter).SelectSingleNode("Customer").Text & CUSE NewXML = NewXML & CNB & xList(Counter).SelectSingleNode("ARSMST_Name").Text & CNE NewXML = NewXML & CPOB & xList(Counter).SelectSingleNode("CustomerPoNumber").Text & CPOE NewXML = NewXML & PCB & xList(Counter).SelectSingleNode("ProductClass").Text & PCE NewXML = NewXML & PCDB & xList(Counter).SelectSingleNode("SALPDS_Description").Text & PCDE NewXML = NewXML & CPONB & xList(Counter).SelectSingleNode("ConfirmedPoNum").Text & CPONE NewXML = NewXML & CPOLB & xList(Counter).SelectSingleNode("ConfirmedPoLine").Text & CPOLE NewXML = NewXML & JOBB & xList(Counter).SelectSingleNode("Job").Text & JOBE NewXML = NewXML & RDE Next Next ' Complete the XML by closing off the root element NewXML = NewXML & NewXMLE CustomizedPane.CodeObject.ListviewData = NewXML End Function