bluebunny72

IDO Update via Formscirpt

Oct 1st, 2025 (edited)
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 1.86 KB | None | 0 0
  1.                 Dim loadResponse As LoadCollectionResponseData
  2.                 Dim strFilter As String
  3.  
  4.                 strFilter = String.Format("JournalId = '{0}' AND BatchStatus = 'P'", journalID)
  5.                 loadResponse = Me.IDOClient.LoadCollection("XXX_JournalBatches", "BatchStatus,BatchId", strFilter, String.Empty, 0)
  6.  
  7.                 Dim count As Integer = loadResponse.Items.Count
  8.  
  9.                 If count > 0 Then
  10.                     For i As Integer = 0 To count - 1
  11.  
  12.                         Dim batchID As Integer = loadResponse(i, "BatchId").GetValue(Of Integer)()
  13.  
  14.                         Dim updateRequest As UpdateCollectionRequestData
  15.  
  16.                         Dim updateResponse As UpdateCollectionResponseData
  17.  
  18.                         Dim item As IDOUpdateItem
  19.  
  20.                         ' Create the update request
  21.  
  22.                         updateRequest = New UpdateCollectionRequestData("XXX_JournalBatches")
  23.  
  24.                         ' Create the item to update
  25.                         ' Update request must include the _ItemId property, or the RecordDate and RowPointer properties.
  26.  
  27.                         item = New IDOUpdateItem(UpdateAction.Update, loadResponse.Items(i).ItemID)
  28.  
  29.                         ' Set the key fields to identify the record
  30.  
  31.                         item.Properties.Add("JournalId", journalID, False)
  32.  
  33.                         item.Properties.Add("BatchId", batchID, False)
  34.  
  35.                         ' Set the field(s) to update
  36.  
  37.                         item.Properties.Add("BatchStatus", "A", True)
  38.  
  39.                         ' Add the item to the request
  40.  
  41.                         updateRequest.Items.Add(item)
  42.  
  43.                         ' Execute the update
  44.  
  45.                         updateResponse = IDOClient.UpdateCollection(updateRequest)
  46.  
  47.                     Next i
  48.  
  49.                 End If           
Advertisement
Add Comment
Please, Sign In to add comment