Использование фильтра с экраном клиента в Acumatica API
Глядя на примеры API от Acumatica, я написал код для экспорта некоторых данных с экрана Customer на основе одного фильтра. Фильтр должен обеспечить, чтобы адрес электронной почты Клиента равнялся определенному значению (как только оно заработает, я также проверю настраиваемое поле с зашифрованным паролем). Однако по какой-то причине функция экспорта возвращает то, что представляется каждой записью клиента в нашей базе данных. Может кто-нибудь сказать, что я делаю не так с моим фильтром, или что-нибудь еще? Код и скриншот отладчика приведены ниже.
Спасибо!
Public Function ValidateUser(ByVal emailAddress As String, ByVal password As String, ByRef customerFirstName As String, ByRef customerLastName As String, ByRef customerCountry As String, ByRef customerPhone As String, ByRef customerCell As String) As String
Dim customer As AR303000Content = m_context.AR303000GetSchema()
m_context.AR303000Clear()
Dim emailFilter As Filter = New Filter()
emailFilter.Field = customer.GeneralInfoMainContact.Email
emailFilter.Condition = FilterCondition.Equals
emailFilter.Value = emailAddress
Dim searchfilters() As Filter = {emailFilter}
Dim searchCommands() As Command = {customer.CustomerSummary.CustomerID, customer.CustomerSummary.CustomerName, customer.GeneralInfoMainContact.Phone1, customer.GeneralInfoMainContact.Phone2, customer.GeneralInfoMainAddress.Country}
Dim searchResult As String()() = m_context.AR303000Export(searchCommands, searchfilters, 0, False, False)
Dim numRecords = searchResult.Length
Dim customerID As String = ""
Dim customerName As String = ""
If numRecords > 0 Then
' we found a user with that email address
Dim i As Integer = 0
For i = 1 To numRecords
customerID = searchResult(i - 1)(0)
customerName = searchResult(i - 1)(1)
customerPhone = searchResult(i - 1)(2)
customerCell = searchResult(i - 1)(3)
customerCountry = searchResult(i - 1)(4)
Next
End If
Dim spaceInName = customerName.IndexOf(" ")
If spaceInName >= 0 Then
customerFirstName = customerName.Substring(0, spaceInName)
customerLastName = customerName.Substring(spaceInName + 1)
End If
Return customerID
End Function