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

Introduce search only fields #483

Merged
merged 1 commit into from
Aug 10, 2021

Conversation

cgunther
Copy link
Contributor

@cgunther cgunther commented Aug 7, 2021

When performing a search, there's additional columns that can be requested that aren't normally on the record. Previously such columns were not accessible via this gem's search results.

Now these columns can be accessed just as you'd access a regular field or read only field.

Starting with InventoryItem and Invoice.

Ultimately, these are fields of the ___SearchRowBasic (ie. ItemSearchRowBasic and TransactionSearchRowBasic), so eventually it may be wise to extract a module encapulating those SearchRowBasic's and include that in the relevant records to avoid duplication of search only fields across multiple records (ie. Estimate, SalesOrder, Invoice, CreditMemo, etc.) that all utilize the same SearchRowBasic.

This is a second attempt at #470, which itself was a second attempt at #426.

When performing a search, there's additional columns that can be
requested that aren't normally on the record. Previously such columns
were not accessible via this gem's search results.

Now these columns can be accessed just as you'd access a regular field
or read only field.

Starting with InventoryItem and Invoice.

Ultimately, these are fields of the ___SearchRowBasic,
ItemSearchRowBasic and TransactionSearchRowBasic, so eventually it may
be wise to extract a module encapulating those SearchRowBasic's and
include that in the relevant records to avoid duplication of search only
fields across multiple records (ie. Estimate, SalesOrder, Invoice,
CreditMemo, etc.) that all utilize the same SearchRowBasic.
@iloveitaly
Copy link
Member

Sorry for the lack of responses on the other PRs. I really like this approach. Super clean. Thanks!

@iloveitaly iloveitaly merged commit 676a618 into NetSweet:master Aug 10, 2021
@iloveitaly
Copy link
Member

@cgunther it would be great to add some readme documentation around this if you have time for another PR.

@cgunther cgunther deleted the search-only-fields branch August 10, 2021 14:15
@cgunther
Copy link
Contributor Author

Thanks for the quick merge!

cgunther added a commit to cgunther/netsuite that referenced this pull request Aug 11, 2021
Attempt to document NetSweet#483.

I wasn't sure how best to convey this given it affects consuming the search results, not performing the search itself. It should also be unsurprising that you'd access these search-only fields the same way you'd access regular or read-only fields.

Had we buried these search-only fields in custom fields, like NetSweet#426 first attempted, then I'd find that more surprising and warranting clearer documentation.
iloveitaly pushed a commit that referenced this pull request Aug 11, 2021
Attempt to document #483.

I wasn't sure how best to convey this given it affects consuming the search results, not performing the search itself. It should also be unsurprising that you'd access these search-only fields the same way you'd access regular or read-only fields.

Had we buried these search-only fields in custom fields, like #426 first attempted, then I'd find that more surprising and warranting clearer documentation.
diegopolido pushed a commit to penrosehill/netsuite that referenced this pull request Oct 7, 2021
When performing a search, there's additional columns that can be
requested that aren't normally on the record. Previously such columns
were not accessible via this gem's search results.

Now these columns can be accessed just as you'd access a regular field
or read only field.

Starting with InventoryItem and Invoice.

Ultimately, these are fields of the ___SearchRowBasic,
ItemSearchRowBasic and TransactionSearchRowBasic, so eventually it may
be wise to extract a module encapulating those SearchRowBasic's and
include that in the relevant records to avoid duplication of search only
fields across multiple records (ie. Estimate, SalesOrder, Invoice,
CreditMemo, etc.) that all utilize the same SearchRowBasic.
diegopolido pushed a commit to penrosehill/netsuite that referenced this pull request Oct 7, 2021
Attempt to document NetSweet#483.

I wasn't sure how best to convey this given it affects consuming the search results, not performing the search itself. It should also be unsurprising that you'd access these search-only fields the same way you'd access regular or read-only fields.

Had we buried these search-only fields in custom fields, like NetSweet#426 first attempted, then I'd find that more surprising and warranting clearer documentation.
@cgunther cgunther mentioned this pull request Oct 20, 2021
cgunther added a commit to cgunther/netsuite that referenced this pull request Oct 20, 2021
A couple were missing for my use case, so I updated them based on 2021.2

This effectively removes the `balance` and `bill_is_residential` fields.
Best I can tell going back to 2014.1, they were never fields. Perhaps
this was a bad copy-paste when first introducing `Estimate` using
another  record as a starting point?

`is_multi_ship_to` was also removed as it's technically a field of
`TransactionSearchRowBasic`, not `Estimate`. It never could have been
set, and at best it only could have been read after a search. Ideally
it'd be reintroduced in the future as an expansion on the work in NetSweet#483,
extracting a common module to represent the fields from
`TransactionSearchRowBasic`.

`bill_address` was also removed as it last appeared in 2014.1. Now it's a
field of `TransactionSearchRowBasic`, so it could be re-introduced
later, like above.

`billing_schedule` was corrected to be a `record_ref`.

`accountingBookDetailList`, `partnersList`, `salesTeamList`,
`shipGroupList`, and `taxDetailsList` are still missing as `record_refs`
as their corresponding classes haven't been implemented yet.

I improved the `have_field` matcher to optionally take a class argument
for testing the fields that are represented by special classes.

I deviated from the standard style of multiple-fields-per-line-wrapped
for a single-field-per-line style. I found the old style hard to read,
particularly when the fields fell out of alphabetical order, when
scanning to see either what fields were available, or what fields were
already supported. I'd imagine this'll make for cleaner git diffs in the
future too.
cgunther added a commit to cgunther/netsuite that referenced this pull request Oct 20, 2021
A couple were missing for my use case, so I updated them based on 2021.2

This effectively removes the `balance` and `bill_is_residential` fields.
Best I can tell going back to 2014.1, they were never fields. Perhaps
this was a bad copy-paste when first introducing `Estimate` using
another  record as a starting point?

`is_multi_ship_to` was also removed as it's technically a field of
`TransactionSearchRowBasic`, not `Estimate`. It never could have been
set, and at best it only could have been read after a search. Ideally
it'd be reintroduced in the future as an expansion on the work in NetSweet#483,
extracting a common module to represent the fields from
`TransactionSearchRowBasic`.

`bill_address` was also removed as it last appeared in 2014.1. Now it's a
field of `TransactionSearchRowBasic`, so it could be re-introduced
later, like above.

`billing_schedule` was corrected to be a `record_ref`.

`accountingBookDetailList`, `partnersList`, `salesTeamList`,
`shipGroupList`, and `taxDetailsList` are still missing as `record_refs`
as their corresponding classes haven't been implemented yet.

I improved the `have_field` matcher to optionally take a class argument
for testing the fields that are represented by special classes.

I deviated from the standard style of multiple-fields-per-line-wrapped
for a single-field-per-line style. I found the old style hard to read,
particularly when the fields fell out of alphabetical order, when
scanning to see either what fields were available, or what fields were
already supported. I'd imagine this'll make for cleaner git diffs in the
future too.
iloveitaly pushed a commit that referenced this pull request Oct 21, 2021
A couple were missing for my use case, so I updated them based on 2021.2

This effectively removes the `balance` and `bill_is_residential` fields.
Best I can tell going back to 2014.1, they were never fields. Perhaps
this was a bad copy-paste when first introducing `Estimate` using
another  record as a starting point?

`is_multi_ship_to` was also removed as it's technically a field of
`TransactionSearchRowBasic`, not `Estimate`. It never could have been
set, and at best it only could have been read after a search. Ideally
it'd be reintroduced in the future as an expansion on the work in #483,
extracting a common module to represent the fields from
`TransactionSearchRowBasic`.

`bill_address` was also removed as it last appeared in 2014.1. Now it's a
field of `TransactionSearchRowBasic`, so it could be re-introduced
later, like above.

`billing_schedule` was corrected to be a `record_ref`.

`accountingBookDetailList`, `partnersList`, `salesTeamList`,
`shipGroupList`, and `taxDetailsList` are still missing as `record_refs`
as their corresponding classes haven't been implemented yet.

I improved the `have_field` matcher to optionally take a class argument
for testing the fields that are represented by special classes.

I deviated from the standard style of multiple-fields-per-line-wrapped
for a single-field-per-line style. I found the old style hard to read,
particularly when the fields fell out of alphabetical order, when
scanning to see either what fields were available, or what fields were
already supported. I'd imagine this'll make for cleaner git diffs in the
future too.
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.

2 participants