Request
Response
XMLOps
VB.NET
C#
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 | <?xml version="1.0" encoding="utf-8"?> <?qbxml version="17.0"?> <QBXML> <QBXMLMsgsRq onError="stopOnError"> <ItemSitesQueryRq metaData="ENUMTYPE" iterator="ENUMTYPE" iteratorID="UUIDTYPE"> <!-- BEGIN OR --> <ListID >IDTYPE</ListID> <!-- optional, may repeat --> <!-- OR --> <!-- BEGIN OR --> <!-- ItemTypeFilter may have one of the following values: AllExceptFixedAsset, Assembly, Discount, FixedAsset, Inventory, InventoryAndAssembly, NonInventory, OtherCharge, Payment, Sales, SalesTax, Service --> <ItemTypeFilter >ENUMTYPE</ItemTypeFilter> <!-- optional --> <!-- OR --> <ItemSiteFilter> <!-- optional --> <ItemFilter> <!-- optional --> <!-- BEGIN OR --> <ListID >IDTYPE</ListID> <!-- optional, may repeat --> <!-- OR --> <FullName >STRTYPE</FullName> <!-- optional, may repeat --> <!-- OR --> <ListIDWithChildren >IDTYPE</ListIDWithChildren> <!-- optional --> <!-- OR --> <FullNameWithChildren >STRTYPE</FullNameWithChildren> <!-- optional --> <!-- END OR --> </ItemFilter> <SiteFilter> <!-- optional --> <!-- BEGIN OR --> <ListID >IDTYPE</ListID> <!-- optional, may repeat --> <!-- OR --> <FullName >STRTYPE</FullName> <!-- optional, may repeat --> <!-- END OR --> </SiteFilter> </ItemSiteFilter> <!-- END OR --> <!-- END OR --> <MaxReturned >INTTYPE</MaxReturned> <!-- optional --> <!-- ActiveStatus may have one of the following values: ActiveOnly [DEFAULT], InactiveOnly, All --> <ActiveStatus >ENUMTYPE</ActiveStatus> <!-- optional --> <IncludeRetElement >STRTYPE</IncludeRetElement> <!-- optional, may repeat --> </ItemSitesQueryRq> <ItemSitesQueryRs statusCode="INTTYPE" statusSeverity="STRTYPE" statusMessage="STRTYPE" retCount="INTTYPE" iteratorRemainingCount="INTTYPE" iteratorID="UUIDTYPE"> <ItemSitesRet> <!-- optional, may repeat --> <ListID >IDTYPE</ListID> <!-- optional --> <TimeCreated >DATETIMETYPE</TimeCreated> <!-- optional --> <TimeModified >DATETIMETYPE</TimeModified> <!-- optional --> <EditSequence >STRTYPE</EditSequence> <!-- optional --> <!-- BEGIN OR --> <ItemInventoryAssemblyRef> <!-- optional --> <ListID >IDTYPE</ListID> <!-- optional --> <FullName >STRTYPE</FullName> <!-- optional --> </ItemInventoryAssemblyRef> <!-- OR --> <ItemInventoryRef> <!-- optional --> <ListID >IDTYPE</ListID> <!-- optional --> <FullName >STRTYPE</FullName> <!-- optional --> </ItemInventoryRef> <!-- END OR --> <InventorySiteRef> <!-- optional --> <ListID >IDTYPE</ListID> <!-- optional --> <FullName >STRTYPE</FullName> <!-- optional --> </InventorySiteRef> <InventorySiteLocationRef> <!-- optional --> <ListID >IDTYPE</ListID> <!-- optional --> <FullName >STRTYPE</FullName> <!-- optional --> </InventorySiteLocationRef> <ReorderLevel >QUANTYPE</ReorderLevel> <!-- optional --> <QuantityOnHand >QUANTYPE</QuantityOnHand> <!-- optional --> <QuantityOnPurchaseOrders >QUANTYPE</QuantityOnPurchaseOrders> <!-- optional --> <QuantityOnSalesOrders >QUANTYPE</QuantityOnSalesOrders> <!-- optional --> <QuantityToBeBuiltByPendingBuildTxns >QUANTYPE</QuantityToBeBuiltByPendingBuildTxns> <!-- optional --> <QuantityRequiredByPendingBuildTxns >QUANTYPE</QuantityRequiredByPendingBuildTxns> <!-- optional --> <QuantityOnPendingTransfers >QUANTYPE</QuantityOnPendingTransfers> <!-- optional --> <AssemblyBuildPoint >QUANTYPE</AssemblyBuildPoint> <!-- optional --> </ItemSitesRet> </ItemSitesQueryRs> </QBXMLMsgsRq> </QBXML> |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 | 'The following sample code is generated as an illustration of
'Creating requests and parsing responses ONLY
'This code is NOT intended to show best practices or ideal code
'Use at your most careful discretion
imports System
imports System.Net
imports System.Drawing
imports System.Collections
imports System.ComponentModel
imports System.Windows.Forms
imports System.Data
imports System.IO
imports Interop.QBFC16
Module com.intuit.idn.samples
Public Class Sample
Public Sub DoItemSitesQuery()
Dim sessionBegun as Boolean
sessionBegun = False
Dim connectionOpen as Boolean
connectionOpen = False
Dim sessionManager as QBSessionManager
sessionManager = nothing
Try
'Create the session Manager object
sessionManager = new QBSessionManager
'Create the message set request object to hold our request
Dim requestMsgSet as IMsgSetRequest
requestMsgSet = sessionManager.CreateMsgSetRequest("US",16,0)
requestMsgSet.Attributes.OnError = ENRqOnError.roeContinue
BuildItemSitesQueryRq(requestMsgSet)
'Connect to QuickBooks and begin a session
sessionManager.OpenConnection("","Sample Code from OSR")
connectionOpen = True
sessionManager.BeginSession("", ENOpenMode.omDontCare)
sessionBegun = True
'Send the request and get the response from QuickBooks
Dim responseMsgSet as IMsgSetResponse
responseMsgSet = sessionManager.DoRequests(requestMsgSet)
'End the session and close the connection to QuickBooks
sessionManager.EndSession()
sessionBegun = False
sessionManager.CloseConnection()
connectionOpen = False
WalkItemSitesQueryRs(responseMsgSet)
Catch e as Exception
MessageBox.Show(e.Message, "Error")
if (sessionBegun) then
sessionManager.EndSession()
End If
if (connectionOpen) then
sessionManager.CloseConnection()
End If
End Try
End Sub
Public Sub BuildItemSitesQueryRq(requestMsgSet as IMsgSetRequest)
Dim ItemSitesQueryRq as IItemSitesQuery
ItemSitesQueryRq= requestMsgSet.AppendItemSitesQueryRq()
Dim ORItemSitesQueryElementType16190 as String
ORItemSitesQueryElementType16190 = "ListIDList"
if (ORItemSitesQueryElementType16190 == "ListIDList") then
'Set field value for ListIDList
'May create more than one of these if needed
ItemSitesQueryRq.ORItemSitesQuery.ListIDList.Add("200000-1011023419")
End If
if (ORItemSitesQueryElementType16190 == "ItemSitesFilter") then
Dim ORItemSitesFilterElementType16191 as String
ORItemSitesFilterElementType16191 = "ItemTypeFilter"
if (ORItemSitesFilterElementType16191 == "ItemTypeFilter") then
'Set field value for ItemTypeFilter
ItemSitesQueryRq.ORItemSitesQuery.ItemSitesFilter.ORItemSitesFilter.ItemTypeFilter.SetValue(ENItemTypeFilter.itfAllExceptFixedAsset)
End If
if (ORItemSitesFilterElementType16191 == "ItemSiteFilter") then
Dim ORItemFilterElementType16192 as String
ORItemFilterElementType16192 = "ListIDList"
if (ORItemFilterElementType16192 == "ListIDList") then
'Set field value for ListIDList
'May create more than one of these if needed
ItemSitesQueryRq.ORItemSitesQuery.ItemSitesFilter.ORItemSitesFilter.ItemSiteFilter.ItemFilter.ORItemFilter.ListIDList.Add("200000-1011023419")
End If
if (ORItemFilterElementType16192 == "FullNameList") then
'Set field value for FullNameList
'May create more than one of these if needed
ItemSitesQueryRq.ORItemSitesQuery.ItemSitesFilter.ORItemSitesFilter.ItemSiteFilter.ItemFilter.ORItemFilter.FullNameList.Add("ab")
End If
if (ORItemFilterElementType16192 == "ListIDWithChildren") then
'Set field value for ListIDWithChildren
ItemSitesQueryRq.ORItemSitesQuery.ItemSitesFilter.ORItemSitesFilter.ItemSiteFilter.ItemFilter.ORItemFilter.ListIDWithChildren.SetValue("200000-1011023419")
End If
if (ORItemFilterElementType16192 == "FullNameWithChildren") then
'Set field value for FullNameWithChildren
ItemSitesQueryRq.ORItemSitesQuery.ItemSitesFilter.ORItemSitesFilter.ItemSiteFilter.ItemFilter.ORItemFilter.FullNameWithChildren.SetValue("ab")
End If
Dim ORSiteFilterElementType16193 as String
ORSiteFilterElementType16193 = "ListIDList"
if (ORSiteFilterElementType16193 == "ListIDList") then
'Set field value for ListIDList
'May create more than one of these if needed
ItemSitesQueryRq.ORItemSitesQuery.ItemSitesFilter.ORItemSitesFilter.ItemSiteFilter.SiteFilter.ORSiteFilter.ListIDList.Add("200000-1011023419")
End If
if (ORSiteFilterElementType16193 == "FullNameList") then
'Set field value for FullNameList
'May create more than one of these if needed
ItemSitesQueryRq.ORItemSitesQuery.ItemSitesFilter.ORItemSitesFilter.ItemSiteFilter.SiteFilter.ORSiteFilter.FullNameList.Add("ab")
End If
End If
End If
'Set field value for MaxReturned
ItemSitesQueryRq.MaxReturned.SetValue(6)
'Set field value for ActiveStatus
ItemSitesQueryRq.ActiveStatus.SetValue(ENActiveStatus.asActiveOnly [DEFAULT])
'Set field value for IncludeRetElementList
'May create more than one of these if needed
ItemSitesQueryRq.IncludeRetElementList.Add("ab")
End Sub
Public Sub WalkItemSitesQueryRs( responseMsgSet as IMsgSetResponse)
if (responseMsgSet is nothing) then
Exit Sub
End If
Dim responseList as IResponseList
responseList = responseMsgSet.ResponseList
if (responseList is nothing) then
Exit Sub
End If
'if we sent only one request, there is only one response, we'll walk the list for this sample
for j=0 to responseList.Count-1
Dim response as IResponse
response = responseList.GetAt(j)
'check the status code of the response, 0=ok, >0 is warning
if (response.StatusCode >= 0) then
'the request-specific response is in the details, make sure we have some
if (not response.Detail is nothing) then
'make sure the response is the type we're expecting
Dim responseType as ENResponseType
responseType = CType(response.Type.GetValue(),ENResponseType)
if (responseType == ENResponseType.rtItemSitesQueryRs) then
'upcast to more specific type here, this is safe because we checked with response.Type check above
Dim ItemSitesRet as IItemSitesRetList
ItemSitesRet = CType(response.Detail,IItemSitesRetList)
WalkItemSitesRet(ItemSitesRet)
End If
End If
End If
Next j
End Sub
Public Sub WalkItemSitesRet(ItemSitesRet as IItemSitesRetList)
if (ItemSitesRet is nothing) then
Exit Sub
End If
'Go through all the elements of IItemSitesRetList
'Get value of ListID
if ( not ItemSitesRet.ListID is nothing) then
Dim ListID16194 as String
ListID16194 = ItemSitesRet.ListID.GetValue()
End If
'Get value of TimeCreated
if ( not ItemSitesRet.TimeCreated is nothing) then
Dim TimeCreated16195 as DateTime
TimeCreated16195 = ItemSitesRet.TimeCreated.GetValue()
End If
'Get value of TimeModified
if ( not ItemSitesRet.TimeModified is nothing) then
Dim TimeModified16196 as DateTime
TimeModified16196 = ItemSitesRet.TimeModified.GetValue()
End If
'Get value of EditSequence
if ( not ItemSitesRet.EditSequence is nothing) then
Dim EditSequence16197 as String
EditSequence16197 = ItemSitesRet.EditSequence.GetValue()
End If
if (not ItemSitesRet.ORItemAssemblyORInventory is nothing) then
if (not ItemSitesRet.ORItemAssemblyORInventory.ItemInventoryAssemblyRef is nothing) then
if (not ItemSitesRet.ORItemAssemblyORInventory.ItemInventoryAssemblyRef. is nothing) then
'Get value of ListID
if ( not ItemSitesRet.ORItemAssemblyORInventory.ItemInventoryAssemblyRef.ListID is nothing) then
Dim ListID16199 as String
ListID16199 = ItemSitesRet.ORItemAssemblyORInventory.ItemInventoryAssemblyRef.ListID.GetValue()
End If
'Get value of FullName
if ( not ItemSitesRet.ORItemAssemblyORInventory.ItemInventoryAssemblyRef.FullName is nothing) then
Dim FullName16200 as String
FullName16200 = ItemSitesRet.ORItemAssemblyORInventory.ItemInventoryAssemblyRef.FullName.GetValue()
End If
End If
End If
if (not ItemSitesRet.ORItemAssemblyORInventory.ItemInventoryRef is nothing) then
if (not ItemSitesRet.ORItemAssemblyORInventory.ItemInventoryRef. is nothing) then
'Get value of ListID
if ( not ItemSitesRet.ORItemAssemblyORInventory.ItemInventoryRef.ListID is nothing) then
Dim ListID16201 as String
ListID16201 = ItemSitesRet.ORItemAssemblyORInventory.ItemInventoryRef.ListID.GetValue()
End If
'Get value of FullName
if ( not ItemSitesRet.ORItemAssemblyORInventory.ItemInventoryRef.FullName is nothing) then
Dim FullName16202 as String
FullName16202 = ItemSitesRet.ORItemAssemblyORInventory.ItemInventoryRef.FullName.GetValue()
End If
End If
End If
End If
if (not ItemSitesRet.InventorySiteRef. is nothing) then
'Get value of ListID
if ( not ItemSitesRet.InventorySiteRef.ListID is nothing) then
Dim ListID16203 as String
ListID16203 = ItemSitesRet.InventorySiteRef.ListID.GetValue()
End If
'Get value of FullName
if ( not ItemSitesRet.InventorySiteRef.FullName is nothing) then
Dim FullName16204 as String
FullName16204 = ItemSitesRet.InventorySiteRef.FullName.GetValue()
End If
End If
if (not ItemSitesRet.InventorySiteLocationRef. is nothing) then
'Get value of ListID
if ( not ItemSitesRet.InventorySiteLocationRef.ListID is nothing) then
Dim ListID16205 as String
ListID16205 = ItemSitesRet.InventorySiteLocationRef.ListID.GetValue()
End If
'Get value of FullName
if ( not ItemSitesRet.InventorySiteLocationRef.FullName is nothing) then
Dim FullName16206 as String
FullName16206 = ItemSitesRet.InventorySiteLocationRef.FullName.GetValue()
End If
End If
'Get value of ReorderLevel
if ( not ItemSitesRet.ReorderLevel is nothing) then
Dim ReorderLevel16207 as Integer
ReorderLevel16207 = ItemSitesRet.ReorderLevel.GetValue()
End If
'Get value of QuantityOnHand
if ( not ItemSitesRet.QuantityOnHand is nothing) then
Dim QuantityOnHand16208 as Integer
QuantityOnHand16208 = ItemSitesRet.QuantityOnHand.GetValue()
End If
'Get value of QuantityOnPurchaseOrders
if ( not ItemSitesRet.QuantityOnPurchaseOrders is nothing) then
Dim QuantityOnPurchaseOrders16209 as Integer
QuantityOnPurchaseOrders16209 = ItemSitesRet.QuantityOnPurchaseOrders.GetValue()
End If
'Get value of QuantityOnSalesOrders
if ( not ItemSitesRet.QuantityOnSalesOrders is nothing) then
Dim QuantityOnSalesOrders16210 as Integer
QuantityOnSalesOrders16210 = ItemSitesRet.QuantityOnSalesOrders.GetValue()
End If
'Get value of QuantityToBeBuiltByPendingBuildTxns
if ( not ItemSitesRet.QuantityToBeBuiltByPendingBuildTxns is nothing) then
Dim QuantityToBeBuiltByPendingBuildTxns16211 as Integer
QuantityToBeBuiltByPendingBuildTxns16211 = ItemSitesRet.QuantityToBeBuiltByPendingBuildTxns.GetValue()
End If
'Get value of QuantityRequiredByPendingBuildTxns
if ( not ItemSitesRet.QuantityRequiredByPendingBuildTxns is nothing) then
Dim QuantityRequiredByPendingBuildTxns16212 as Integer
QuantityRequiredByPendingBuildTxns16212 = ItemSitesRet.QuantityRequiredByPendingBuildTxns.GetValue()
End If
'Get value of QuantityOnPendingTransfers
if ( not ItemSitesRet.QuantityOnPendingTransfers is nothing) then
Dim QuantityOnPendingTransfers16213 as Integer
QuantityOnPendingTransfers16213 = ItemSitesRet.QuantityOnPendingTransfers.GetValue()
End If
'Get value of AssemblyBuildPoint
if ( not ItemSitesRet.AssemblyBuildPoint is nothing) then
Dim AssemblyBuildPoint16214 as Integer
AssemblyBuildPoint16214 = ItemSitesRet.AssemblyBuildPoint.GetValue()
End If
End Sub
End Class
End Module
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 | //The following sample code is generated as an illustration of //Creating requests and parsing responses ONLY //This code is NOT intended to show best practices or ideal code //Use at your most careful discretion using System; using System.Net; using System.Drawing; using System.Collections; using System.ComponentModel; using System.Windows.Forms; using System.Data; using System.IO; using Interop.QBFC16; namespace com.intuit.idn.samples { public class Sample { public void DoItemSitesQuery() { bool sessionBegun = false; bool connectionOpen = false; QBSessionManager sessionManager = null; try { //Create the session Manager object sessionManager = new QBSessionManager(); //Create the message set request object to hold our request IMsgSetRequest requestMsgSet = sessionManager.CreateMsgSetRequest("US",16,0); requestMsgSet.Attributes.OnError = ENRqOnError.roeContinue; BuildItemSitesQueryRq(requestMsgSet); //Connect to QuickBooks and begin a session sessionManager.OpenConnection("","Sample Code from OSR"); connectionOpen = true; sessionManager.BeginSession("", ENOpenMode.omDontCare); sessionBegun = true; //Send the request and get the response from QuickBooks IMsgSetResponse responseMsgSet = sessionManager.DoRequests(requestMsgSet); //End the session and close the connection to QuickBooks sessionManager.EndSession(); sessionBegun = false; sessionManager.CloseConnection(); connectionOpen = false; WalkItemSitesQueryRs(responseMsgSet); } catch (Exception e) { MessageBox.Show(e.Message, "Error"); if (sessionBegun) { sessionManager.EndSession(); } if (connectionOpen) { sessionManager.CloseConnection(); } } } void BuildItemSitesQueryRq(IMsgSetRequest requestMsgSet) { IItemSitesQuery ItemSitesQueryRq= requestMsgSet.AppendItemSitesQueryRq(); //Set attributes //Set field value for metaData ItemSitesQueryRq.metaData.SetValue("IQBENmetaDataType"); //Set field value for iterator ItemSitesQueryRq.iterator.SetValue("IQBENiteratorType"); //Set field value for iteratorID ItemSitesQueryRq.iteratorID.SetValue("IQBUUIDType"); string ORItemSitesQueryElementType16165 = "ListIDList"; if (ORItemSitesQueryElementType16165 == "ListIDList") { //Set field value for ListIDList //May create more than one of these if needed ItemSitesQueryRq.ORItemSitesQuery.ListIDList.Add("200000-1011023419"); } if (ORItemSitesQueryElementType16165 == "ItemSitesFilter") { string ORItemSitesFilterElementType16166 = "ItemTypeFilter"; if (ORItemSitesFilterElementType16166 == "ItemTypeFilter") { //Set field value for ItemTypeFilter ItemSitesQueryRq.ORItemSitesQuery.ItemSitesFilter.ORItemSitesFilter.ItemTypeFilter.SetValue(ENItemTypeFilter.itfAllExceptFixedAsset); } if (ORItemSitesFilterElementType16166 == "ItemSiteFilter") { string ORItemFilterElementType16167 = "ListIDList"; if (ORItemFilterElementType16167 == "ListIDList") { //Set field value for ListIDList //May create more than one of these if needed ItemSitesQueryRq.ORItemSitesQuery.ItemSitesFilter.ORItemSitesFilter.ItemSiteFilter.ItemFilter.ORItemFilter.ListIDList.Add("200000-1011023419"); } if (ORItemFilterElementType16167 == "FullNameList") { //Set field value for FullNameList //May create more than one of these if needed ItemSitesQueryRq.ORItemSitesQuery.ItemSitesFilter.ORItemSitesFilter.ItemSiteFilter.ItemFilter.ORItemFilter.FullNameList.Add("ab"); } if (ORItemFilterElementType16167 == "ListIDWithChildren") { //Set field value for ListIDWithChildren ItemSitesQueryRq.ORItemSitesQuery.ItemSitesFilter.ORItemSitesFilter.ItemSiteFilter.ItemFilter.ORItemFilter.ListIDWithChildren.SetValue("200000-1011023419"); } if (ORItemFilterElementType16167 == "FullNameWithChildren") { //Set field value for FullNameWithChildren ItemSitesQueryRq.ORItemSitesQuery.ItemSitesFilter.ORItemSitesFilter.ItemSiteFilter.ItemFilter.ORItemFilter.FullNameWithChildren.SetValue("ab"); } string ORSiteFilterElementType16168 = "ListIDList"; if (ORSiteFilterElementType16168 == "ListIDList") { //Set field value for ListIDList //May create more than one of these if needed ItemSitesQueryRq.ORItemSitesQuery.ItemSitesFilter.ORItemSitesFilter.ItemSiteFilter.SiteFilter.ORSiteFilter.ListIDList.Add("200000-1011023419"); } if (ORSiteFilterElementType16168 == "FullNameList") { //Set field value for FullNameList //May create more than one of these if needed ItemSitesQueryRq.ORItemSitesQuery.ItemSitesFilter.ORItemSitesFilter.ItemSiteFilter.SiteFilter.ORSiteFilter.FullNameList.Add("ab"); } } } //Set field value for MaxReturned ItemSitesQueryRq.MaxReturned.SetValue(6); //Set field value for ActiveStatus ItemSitesQueryRq.ActiveStatus.SetValue(ENActiveStatus.asActiveOnly [DEFAULT]); //Set field value for IncludeRetElementList //May create more than one of these if needed ItemSitesQueryRq.IncludeRetElementList.Add("ab"); } void WalkItemSitesQueryRs(IMsgSetResponse responseMsgSet) { if (responseMsgSet == null) return; IResponseList responseList = responseMsgSet.ResponseList; if (responseList == null) return; //if we sent only one request, there is only one response, we'll walk the list for this sample for(int i=0; i < responseList.Count; i++) { IResponse response = responseList.GetAt(i); //check the status code of the response, 0=ok, >0 is warning if (response.StatusCode >= 0) { //the request-specific response is in the details, make sure we have some if (response.Detail != null) { //make sure the response is the type we're expecting ENResponseType responseType = (ENResponseType)response.Type.GetValue(); if (responseType == ENResponseType.rtItemSitesQueryRs) { //upcast to more specific type here, this is safe because we checked with response.Type check above IItemSitesRetList ItemSitesRet = (IItemSitesRetList)response.Detail; WalkItemSitesRet(ItemSitesRet); } } } } } void WalkItemSitesRet(IItemSitesRetList ItemSitesRet) { if (ItemSitesRet == null) return; //Go through all the elements of IItemSitesRetList //Get value of ListID if (ItemSitesRet.ListID != null) { string ListID16169 = (string)ItemSitesRet.ListID.GetValue(); } //Get value of TimeCreated if (ItemSitesRet.TimeCreated != null) { DateTime TimeCreated16170 = (DateTime)ItemSitesRet.TimeCreated.GetValue(); } //Get value of TimeModified if (ItemSitesRet.TimeModified != null) { DateTime TimeModified16171 = (DateTime)ItemSitesRet.TimeModified.GetValue(); } //Get value of EditSequence if (ItemSitesRet.EditSequence != null) { string EditSequence16172 = (string)ItemSitesRet.EditSequence.GetValue(); } if (ItemSitesRet.ORItemAssemblyORInventory != null) { if (ItemSitesRet.ORItemAssemblyORInventory.ItemInventoryAssemblyRef != null) { if (ItemSitesRet.ORItemAssemblyORInventory.ItemInventoryAssemblyRef != null) { //Get value of ListID if (ItemSitesRet.ORItemAssemblyORInventory.ItemInventoryAssemblyRef.ListID != null) { string ListID16174 = (string)ItemSitesRet.ORItemAssemblyORInventory.ItemInventoryAssemblyRef.ListID.GetValue(); } //Get value of FullName if (ItemSitesRet.ORItemAssemblyORInventory.ItemInventoryAssemblyRef.FullName != null) { string FullName16175 = (string)ItemSitesRet.ORItemAssemblyORInventory.ItemInventoryAssemblyRef.FullName.GetValue(); } } } if (ItemSitesRet.ORItemAssemblyORInventory.ItemInventoryRef != null) { if (ItemSitesRet.ORItemAssemblyORInventory.ItemInventoryRef != null) { //Get value of ListID if (ItemSitesRet.ORItemAssemblyORInventory.ItemInventoryRef.ListID != null) { string ListID16176 = (string)ItemSitesRet.ORItemAssemblyORInventory.ItemInventoryRef.ListID.GetValue(); } //Get value of FullName if (ItemSitesRet.ORItemAssemblyORInventory.ItemInventoryRef.FullName != null) { string FullName16177 = (string)ItemSitesRet.ORItemAssemblyORInventory.ItemInventoryRef.FullName.GetValue(); } } } } if (ItemSitesRet.InventorySiteRef != null) { //Get value of ListID if (ItemSitesRet.InventorySiteRef.ListID != null) { string ListID16178 = (string)ItemSitesRet.InventorySiteRef.ListID.GetValue(); } //Get value of FullName if (ItemSitesRet.InventorySiteRef.FullName != null) { string FullName16179 = (string)ItemSitesRet.InventorySiteRef.FullName.GetValue(); } } if (ItemSitesRet.InventorySiteLocationRef != null) { //Get value of ListID if (ItemSitesRet.InventorySiteLocationRef.ListID != null) { string ListID16180 = (string)ItemSitesRet.InventorySiteLocationRef.ListID.GetValue(); } //Get value of FullName if (ItemSitesRet.InventorySiteLocationRef.FullName != null) { string FullName16181 = (string)ItemSitesRet.InventorySiteLocationRef.FullName.GetValue(); } } //Get value of ReorderLevel if (ItemSitesRet.ReorderLevel != null) { int ReorderLevel16182 = (int)ItemSitesRet.ReorderLevel.GetValue(); } //Get value of QuantityOnHand if (ItemSitesRet.QuantityOnHand != null) { int QuantityOnHand16183 = (int)ItemSitesRet.QuantityOnHand.GetValue(); } //Get value of QuantityOnPurchaseOrders if (ItemSitesRet.QuantityOnPurchaseOrders != null) { int QuantityOnPurchaseOrders16184 = (int)ItemSitesRet.QuantityOnPurchaseOrders.GetValue(); } //Get value of QuantityOnSalesOrders if (ItemSitesRet.QuantityOnSalesOrders != null) { int QuantityOnSalesOrders16185 = (int)ItemSitesRet.QuantityOnSalesOrders.GetValue(); } //Get value of QuantityToBeBuiltByPendingBuildTxns if (ItemSitesRet.QuantityToBeBuiltByPendingBuildTxns != null) { int QuantityToBeBuiltByPendingBuildTxns16186 = (int)ItemSitesRet.QuantityToBeBuiltByPendingBuildTxns.GetValue(); } //Get value of QuantityRequiredByPendingBuildTxns if (ItemSitesRet.QuantityRequiredByPendingBuildTxns != null) { int QuantityRequiredByPendingBuildTxns16187 = (int)ItemSitesRet.QuantityRequiredByPendingBuildTxns.GetValue(); } //Get value of QuantityOnPendingTransfers if (ItemSitesRet.QuantityOnPendingTransfers != null) { int QuantityOnPendingTransfers16188 = (int)ItemSitesRet.QuantityOnPendingTransfers.GetValue(); } //Get value of AssemblyBuildPoint if (ItemSitesRet.AssemblyBuildPoint != null) { int AssemblyBuildPoint16189 = (int)ItemSitesRet.AssemblyBuildPoint.GetValue(); } } } } |