Skip to content

Commit

Permalink
Merge pull request #23 from CloudsnapInc/multi_select_support
Browse files Browse the repository at this point in the history
[L3-109] fix multiselect bug
  • Loading branch information
dbbarkley authored Mar 9, 2021
2 parents d74d3be + 67a0215 commit a4460fe
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions lib/netsuite/records/custom_field_list.rb
Original file line number Diff line number Diff line change
Expand Up @@ -113,12 +113,15 @@ def extract_custom_field(custom_field_data)
if type == "platformCore:SelectCustomFieldRef"
attrs[:value] = CustomRecordRef.new(custom_field_data[:value])
elsif type == 'platformCore:MultiSelectCustomFieldRef'
attrs[:value] = custom_field_data[:value].map do |entry|
CustomRecordRef.new(entry)
# if only one value of multiselect is selected it will be a hash, not an array
if attrs[:value].is_a?(Array)
attrs[:value] = custom_field_data[:value].map { |entry| CustomRecordRef.new(entry) }
else
attrs[:value] = CustomRecordRef.new(custom_field_data[:value])
end
end

custom_fields << CustomField.new(attrs)

end
end

Expand Down

0 comments on commit a4460fe

Please sign in to comment.