Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid repeating field definitions #488

Conversation

cgunther
Copy link
Contributor

In adding the start of search_only_fields, a couple standard fields were mistakenly re-defined as search_only_fields, which ended up excluding. them when pushing data to NetSuite, under the guise they were search-only.

Now it's impossible to define the same field twice.

As a result, had to fix a number of occurrences of fields repeated between fields and another definition (ie record_refs, read_only_fields, field).

The only notable fix is on Invoice, where bill_address and ship_address were previously defined as fields, then got repeated as search_only_fields. In old APIs (<= 2014.1), these seemed to actually be fields, however in newer APIs (>= 2014.2), they no longer are. I'm erring on the side of newer APIs here, removing them as fields and leaving them as search_only_fields.

Fixed #486

Support::Sublist already defines the replace_all field.
In adding the start of search_only_fields, a couple standard fields were
mistakenly re-defined as search_only_fields, which ended up excluding
them when pushing data to NetSuite, under the guise they were
search-only.

Now it's impossible to define the same field twice.

As a result, had to fix a number of occurrences of fields repeated
between `fields` and another definition (ie `record_refs`,
`read_only_fields`, `field`).

The only notable fix is on `Invoice`, where `bill_address` and
`ship_address` were previously defined as `fields`, then got repeated as
`search_only_fields`. In old APIs (<= 2014.1), these seemed to actually
be fields, however in newer APIs (>= 2014.2), they no longer are. I'm
erring on the side of newer APIs here, removing them as `fields` and
leaving them as `search_only_fields`.

Fixed NetSweet#486
@iloveitaly
Copy link
Member

@cgunther great change, thanks!

Re: invoice change, this shouldn't cause any breaking changes for users unless they are on a 2014 API version. I think biasing towards the most recent API version makes sense. Would be good to note this in the changelog though.

@iloveitaly iloveitaly merged commit b15f5cb into NetSweet:master Sep 6, 2021
@cgunther cgunther deleted the avoid-repeating-field-in-read-or-search-only branch September 7, 2021 13:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Search only fields are not added to an upsert/add payload
2 participants