Permalink
Browse files

Add support for GetSelectValue

  • Loading branch information...
1 parent 1bd1bb0 commit e5dce25cddba4240477ec3dbb486c7e51c18d677 @tmann-ttc tmann-ttc committed Jun 25, 2012
Showing with 13 additions and 0 deletions.
  1. +7 −0 lib/netsuite_client/client.rb
  2. +6 −0 test/netsuite_client_test.rb
@@ -128,6 +128,13 @@ def delete(ref)
NetsuiteResult.new(res.writeResponse)
end
+ def get_select_value(klass, field)
+ fieldDescription = GetSelectValueFieldDescription.new
+ fieldDescription.recordType = constantize(klass)
+ fieldDescription.field = field
+ res = @driver.getSelectValue(:fieldDescription => fieldDescription, :pageIndex => 1).getSelectValueResult
+ res.status.xmlattr_isSuccess ? res.baseRefList : nil
+ end
# Get the full result set (possibly across multiple pages).
def full_basic_search(basic)
@@ -37,6 +37,12 @@ def test_get_all
assert records.all? {|r| r.class.to_s == 'NetSuite::SOAP::Currency'}
end
+ def test_get_select_value
+ values = @client.get_select_value('RecordType::SupportCase', 'origin')
+ assert values.count > 0
+ assert values.find {|value| value.name == "Web"}
+ end
+
# inventory item tests are currently disabled
# FIXME: 2011_2 requires cogs and asset accounts
# def test_add_inventory_item

0 comments on commit e5dce25

Please sign in to comment.