README.md in netsuite-0.8.0 vs README.md in netsuite-0.8.1

- old
+ new

@@ -71,10 +71,20 @@ account '12345' role 1111 end ``` +If you'd like to use a API endpoints greater than 2015_1 you'll need to specify an application ID: + +``` +NetSuite::Configuration.soap_header = { + 'platformMsgs:ApplicationInfo' => { + 'platformMsgs:applicationId' => 'your-netsuite-app-id' + } +} +``` + OAuth credentials are also supported. [Learn more about how to set up token based authentication here](http://mikebian.co/using-netsuites-token-based-authentication-with-suitetalk/). ```ruby NetSuite.configure do reset! @@ -85,11 +95,11 @@ consumer_secret ENV['NETSUITE_CONSUMER_SECRET'] token_id ENV['NETSUITE_TOKEN_ID'] token_secret ENV['NETSUITE_TOKEN_SECRET'] # oauth does not work with API versions less than 2015_2 - api_version '2015_2' + api_version '2016_2' end ``` ### Examples @@ -135,10 +145,23 @@ NetSuite::Records::BaseRefList.get_select_value( recordType: 'serviceSaleItem', field: 'taxSchedule' ) +# get options for a custom sublist field (i.e. transaction column fields) +NetSuite::Records::BaseRefList.get_select_value( + field: 'custcol69_2', + sublist: 'itemList', + recordType: 'salesOrder' +) + +# output names of options available for a custom field +options = NetSuite::Records::BaseRefList.get_select_value( + field: 'custbody_order_source', + recordType: 'invoice' +) +options.base_refs.map(&:name) ``` #### Custom Records & Fields ```ruby @@ -204,10 +227,14 @@ ] }) `open https://system.netsuite.com/app/common/entity/custjob.nl?id=#{search.results.first.internal_id}` +# find the avalara tax item. Some records don't support search. +all_sales_taxes = NetSuite::Utilities.backoff { NetSuite::Records::SalesTaxItem.get_all } +ns_tax_code = all_sales_taxes.detect { |st| st.item_id == 'AVATAX' } + # searching for custom records NetSuite::Records::CustomRecord.search( basic: [ { field: 'recType', @@ -487,16 +514,6 @@ 'platformCore:record' => { '@recordType' => 'state' } }) states.to_array.first[:get_all_response][:get_all_result][:record_list][:record].map { |r| { country: r[:country], abbr: r[:shortname], name: r[:full_name] } } -``` - -#### 2015_2 ApplicationId Support - -```ruby -NetSuite::Configuration.soap_header = { - 'platformMsgs:ApplicationInfo' => { - 'platformMsgs:applicationId' => 'your-netsuite-app-id' - } -} ```