1

我正在尝试使用 Acumatica Web 服务 API 为客户导出所有位置。我希望使用 Locations 屏幕我可以在 Customer ID 字段上设置一个过滤器,我认为它是 LocationSummary.Customer,这将返回该客户的所有 Locations。相反,我总是返回 0 个结果。代码如下,我还展示了 ID 为 012349 的测试客户存在的位置的屏幕截图,调试器结果显示返回 0 条记录。

Public Function GetAddressList(ByVal customerID As String) As String()()
    Dim address As CR303010Content = m_context.CR303010GetSchema()
    m_context.CR303010Clear()

    Dim customerFilter As Filter = New Filter()
    customerFilter.Field = address.LocationSummary.Customer
    customerFilter.Condition = FilterCondition.Equals
    customerFilter.Value = customerID

    Dim searchfilters() As Filter = {customerFilter}
    Dim searchCommands() As Command = {address.LocationSummary.Customer, address.LocationSummary.LocationID, address.GeneralInfoLocationAddress.AddressLine1, address.GeneralInfoLocationAddress.City}
    Dim searchResult As String()() = m_context.CR303010Export(searchCommands, searchfilters, 0, False, False)

    Return searchResult
End Function

ERP 中显示的位置

调试器显示长度为 0 的 searchResult 数组 调试器中返回的位置

4

1 回答 1

0

我尝试了您的示例,但无法使用过滤器使其正常工作。我稍微修改了它以传递customerID搜索命令,并添加ServiceCommands.EveryLocationID到它以指定我们希望系统循环遍历所有位置:

    Dim searchCustomer As New Value() With {.Value = customerID, .LinkedCommand = address.LocationSummary.BusinessAccount}
    Dim searchCommands() As Command = {searchCustomer,
                                       address.LocationSummary.ServiceCommands.EveryLocationID, address.LocationSummary.LocationID, address.GeneralInfoLocationAddress.AddressLine1, address.GeneralInfoLocationAddress.City}
    Dim searchResult As String()() = screen.Export(searchCommands, Nothing, 0, False, False)
于 2015-03-24T21:58:56.793 回答