forked from NetSweet/netsuite
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix accessing custom field values returned in advanced search results (…
…NetSweet#480) NetSuite seems to wrap values in a `searchValue` element rather than just `value`, breaking the ability to access those values the same in an advanced search as compared to either a basic search or simple `get`. Previously, you'd access the value via `my_record.custom_field_list.my_custom_field.attributes.fetch(:search_value)`, and if it was a `CustomRecordRef`, you'd get a raw hash back, not an instance of `CustomRecordRef`. Now, you'd access the value via `my_record.custom_field_list.my_custom_field.value`, so it's consistent across `get`, basic, and advanced searches, plus you'd get an instance of `CustomRecordRef`, where appropriate. Co-authored-by: Michael Bianco <[email protected]>
- Loading branch information
1 parent
fe7f9ff
commit 6d0babe
Showing
4 changed files
with
32 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -171,6 +171,8 @@ | |
expect(search.results.first.internal_id).to eq('123') | ||
expect(search.results.first.external_id).to eq('456') | ||
expect(search.results.first.alt_name).to eq('A Awesome Name') | ||
expect(search.results.first.custom_field_list.custitem_stringfield.value).to eq('sample string value') | ||
expect(search.results.first.custom_field_list.custitem_apcategoryforsales.value.internal_id).to eq('4') | ||
expect(search.results.last.email).to eq('[email protected]') | ||
end | ||
end | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters