Skip to content

Advanced search column Account search does not parse fields from results #581

@sbudker-stripe

Description

@sbudker-stripe

Problem: When searching accounts with specified columns we see a successful request and response from the SuiteTalk API but the gem does not correctly parse the response. Specifically we create the search result and populate the instance fields here If we get values returned in the search response which we don't have defined as a field on Account we don't populate anything for these.

Repro:

Make an example call like below for a instantiated client.

accounts = NetSuite::Records::Account.search(
        criteria: {
          basic: [
            {
              field: "isInactive",
              value: false
            }
          ]
        },
        columns: {
          "listAcct:basic" => [
            "platformCommon:internalId/" => {},
            "platformCommon:name/" => {}
          ]
        }
      )

Assuming results, see that accounts.results.first.name is nil while the Suitetalk XML response does populate this value. accounts.results.first.internal_id is populated because we have special handling see here and here.

Gem version: 0.9.3
SuiteTalk API version: 2018_1

Notes:

  • The fields defined on the Account model can be named differently than the results from the AccountSearchRowBasic fields.

  • This was discovered when improving search performance. This same issue may be applicable to other models within this gem.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions