Segment7_Retrieve
  • 1 Minute to read
  • Dark
    Light
  • PDF

Segment7_Retrieve

  • Dark
    Light
  • PDF

Article summary

Usage

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

Use the Segment7_Retrieve call to retrieve Segment7 data. When a Client application invokes the Segment7_Retrieve call, it passes in the segment7 filter criteria in collection of SegmentFilter objects to filter the data rows.

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

Request

Shell Syntax

Segment7 = api.Segment7_Retrieve (SegmentFilter FilterCriteria)

XML

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns="http://www.HostAnalytics.com/API/SOAP/StateFree/Common/2009/03/19">
   <soapenv:Header/>
   <soapenv:Body>
    <ns:Segment7_RetrieveWithLogin>
        <ns:LoginName>***</ns:LoginName>
        <ns:Password>***</ns:Password>
        <ns:TenantCode>***</ns:TenantCode>
    </ns:Segment7_RetrieveWithLogin>
   </soapenv:Body>
</soapenv:Envelope>

Arguments List

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

NameTypeDescription

SegmentFilter

SegmentFilter()

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

Response

The Segment7_Retrieve method call returns collection of Segment7 objects, which contain the data values of segment7 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.

Shell Syntax

Private Sub RetrieveSegment7()
  Dim api As New HostAPI()
  'This method retrieves all segment objects that start with the code specified.
  Dim objSegment7() As Segment7, objSegment7Filter As Segment7Filter
  Dim objSegment7FilterCollection() As Segment7Filters, strValue() As String
  Try
  	'Create a new segment7 filter to add the filter criteria during retrieval
  	objSegment7Filter = New Segment7Filter
  	objSegment7Filter.Field = Segment7Field.Code
  	objSegment7Filter.FieldOperator = FieldOperator.StartsWith 
  	ReDim strValue(0)
  	strValue(0) = "10"
  	objSegment7Filter.Value = strValue
  	'Add the filter objects built to the filter collection to pass to the web method
  	ReDim objSegment7FilterCollection(0)
  	objSegment7FilterCollection(0) = New Segment7Filter
  	objSegment7FilterCollection(0) = objSegment7Filter
  	'Call the web method to retrieve the segment7 collection
  	objSegment7 = api.Segment7_Retrieve (objSegment7FilterCollection)
  	'Loop through the segment7 collection to display the segment7 objects retrieved
  	If Not objSegment7 is Nothing Then
  		Console.WriteLine ("Code" & vbTab & "|" &_Obj.Name & vbTab &
  		"|AccountGroup" & vbTab & "|AccountyType")
  		For Each _Obj As Segment7 In objSegment7
  			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?