Segment1_Retrieve
  • 1 Minute to read
  • Dark
    Light
  • PDF

Segment1_Retrieve

  • Dark
    Light
  • PDF

Article summary

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

Syntax

Segment1 = api.Segment1_Retrieve (Segment1Filter FilterCriteria)

Usage

Use the Segment1_Retrieve call to retrieve Segment1 data. When a Client application invokes the Segment1_Retrieve call, it passes the segment1 filter criteria in collection of Segment1Filter objects to filter the data rows.

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

Arguments List

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

Name
Type
Description

Segment1Filter

Segment1F

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

Response

The Segment1_Retrieve method call returns a collection of Segment1 objects, which contain the data values of segment1 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.

Parent Code, Parent Name

There are two separate fields (i.e., columns) for Parent Code and Parent Name.

Sample Code

Private Sub RetrieveSegment1()
  Dim api As New HostAPI()
  'This method retrieves all segment1 objects that start with the code specified.
  Dim objSegment1() As Segment1, objSegment1Filter As Segment1Filter
  Dim objSegment1FilterCollection() As Segment1Filters, strValue() As String
  Try
  	'Create a new segment1 filter to add the filter criteria during retrieval
  	objSegment1Filter = New Segment1Filter
  	objSegment1Filter.Field = Segment1Field.Code
  	objSegment1Filter.FieldOperator = FieldOperator.StartsWith 
  	ReDim strValue(0)
  	strValue(0) = "10"
  	objSegment1Filter.Value = strValue
  	'Add the filter objects built to the filter collection to pass to the web method
  	ReDim objSegment1FilterCollection(0)
  	objSegment1FilterCollection(0) = New Segment1Filter
  	objSegment1FilterCollection(0) = objSegment1Filter
  	'Call the web method to retrieve the segment1 collection
  	objSegment1 = api.Segment1_Retrieve (objSegment1FilterCollection)
  	'Loop through the segment1 collection to display the segment1 objects retrieved
  	If Not objSegment1 is Nothing Then
  		Console.WriteLine ("Code" & vbTab & "|" &_Obj.Name & vbTab &
  		"|AccountGroup" & vbTab & "|AccountyType")
  		For Each _Obj As Segment1 In objSegment1
  			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?