diff --git a/lib/netsuite/support/search_result.rb b/lib/netsuite/support/search_result.rb index 901c46edf..bd7071a18 100644 --- a/lib/netsuite/support/search_result.rb +++ b/lib/netsuite/support/search_result.rb @@ -89,6 +89,10 @@ def initialize(response, result_class, credentials) record[:basic][:internal_id] = record[:basic][:internal_id][:@internal_id] end + if record[:basic][:external_id] + record[:basic][:external_id] = record[:basic][:external_id][:@external_id] + end + result_wrapper = result_class.new(record.delete(:basic)) result_wrapper.search_joins = record results << result_wrapper diff --git a/spec/netsuite/actions/search_spec.rb b/spec/netsuite/actions/search_spec.rb index a3cbfea04..2f0abbec4 100644 --- a/spec/netsuite/actions/search_spec.rb +++ b/spec/netsuite/actions/search_spec.rb @@ -168,6 +168,8 @@ expect(search.results.size).to eq(2) expect(search.current_page).to eq(1) + 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.last.email).to eq('alessawesome@gmail.com') end diff --git a/spec/support/fixtures/search/saved_search_joined_custom_customer.xml b/spec/support/fixtures/search/saved_search_joined_custom_customer.xml index 490270e97..68b3fa4d5 100644 --- a/spec/support/fixtures/search/saved_search_joined_custom_customer.xml +++ b/spec/support/fixtures/search/saved_search_joined_custom_customer.xml @@ -16,6 +16,12 @@ + + + + + + A Awesome Name @@ -84,4 +90,4 @@ - \ No newline at end of file +