Segment8_Retrieve
  • 1 Minute to read
  • Dark
    Light
  • PDF

Segment8_Retrieve

  • Dark
    Light
  • PDF

Article summary

Retrieves the collection of Segment8 objects that meet the filter criteria supplied. Each segment8 object returned from this method corresponds to a data row of segment8 in database.

Syntax

Segment8 = api.Segment8_Retrieve (SegmentFilter FilterCriteria)

Usage

Use the Segment8_Retrieve call to retrieve Segment8 data. When a Client application invokes the Segment8_Retrieve call, it passes in the segment8 filter criteria in collection of SegmentFilter objects to filter the data rows.

Upon invocation, the Web Service queries the database for segment8 data rows with the specified filter criteria and returns the collection of segment8 objects. Each segment8 object corresponds to a data row in the database. The Client application can then use methods on the collection of segment8 objects to iterate through the collection and retrieve information. The Client application must be logged in with sufficient access rights to query segment8 objects.

Arguments List

The following table provides a list of arguments that are required for the Segment8_Retrieve method call:

Name
Type
Description

SegmentFilter

SegmentFilter()

Collection of segment8 filter objects to filter the segment8 data rows during retrieval.

Response

The Segment8_Retrieve method call returns collection of Segment8 objects, which contain the

data values of segment8 data rows in the database. In recent updates, the retrieved data will also have the IDs of all the Leaf, Roll-Up, and Parent Members.

Sample Code

Private Sub RetrieveSegment8()
  Dim api As New HostAPI()
  'This method retrieves all segment objects that start with the code specified.
  Dim objSegment8() As Segment8, objSegment8Filter As Segment8Filter
  Dim objSegment8FilterCollection() As Segment8Filters, strValue() As String
  Try
  	'Create a new segment8 filter to add the filter criteria during retrieval
  	objSegment8Filter = New Segment8Filter
  	objSegment8Filter.Field = Segment8Field.Code
  	objSegment8Filter.FieldOperator = FieldOperator.StartsWith 
  	ReDim strValue(0)
  	strValue(0) = "10"
  	objSegment8Filter.Value = strValue
  	'Add the filter objects built to the filter collection to pass to the web method
  	ReDim objSegment8FilterCollection(0)
  	objSegment8FilterCollection(0) = New Segment8Filter
  	objSegment8FilterCollection(0) = objSegment8Filter
  	'Call the web method to retrieve the segment8 collection
  	objSegment8 = api.Segment8_Retrieve (objSegment8FilterCollection)
  	'Loop through the segment8 collection to display the segment8 objects retrieved
  	If Not objSegment8 is Nothing Then
  		Console.WriteLine ("Code" & vbTab & "|" &_Obj.Name & vbTab &
  		"|AccountGroup" & vbTab & "|AccountyType")
  		For Each _Obj As Segment8 In objSegment8
  			Console.WriteLine (_Obj.Code & vbTab & "|" _Obj.Name & vbTab &
  			"|" & _Obj.AccountGroup.ToString() & vbTab & "|" &
  			_Obj.AccountType.ToString())
  		Next
  	End If
  	Console.ReadLine()
  Catch ex As Exception
  End Try
End Sub

Was this article helpful?