Error when getting a transaction using Netsuite Ruby Gem - Savon::SOAPFault: (soapenv:Server.userException) -


i'm using netsuite ruby gem (https://github.com/revolutionprep/netsuite).

i talked founder of gem , i'm using correct way of grabbing transaction: https://github.com/revolutionprep/netsuite/issues/52

in gemfile:

gem 'netsuite' 

i keep getting when doing transaction search:

1.9.3p448 :008 > search = netsuite::records::transaction.get(3820) httpi request webservices.netsuite.com (net_http) httpi post request webservices.netsuite.com (net_http) savon::soapfault: (soapenv:server.userexception) org.xml.sax.saxexception: transaction not legal value {urn:types.core_2013_2.platform.webservices.netsuite.com}recordtype 

this gives same error well:

search = netsuite::records::transaction.get(:internal_id => 3820) 

this works:

def getalltransactions     #searchstringfield, searchvalue      t = time.new       search = netsuite::records::transaction.search({         criteria: {         basic: [             {                 field: 'type',                 operator: 'anyof',                 type: 'searchenummultiselectfield',                 value: [ "_invoice" ]             },             {                 field: 'trandate',                 operator: 'within',                  type: 'searchdatefield',                 value: [                       date.parse("12/1/2013").strftime("%y-%m-%dt%h:%m:%s%z"),                       date.parse("#{t.month}/#{t.day}/#{t.year}").strftime("%y-%m-%dt%h:%m:%s%z")                     ]             }             ]         }     })      search end 

and works too:

netsuite::records::customer.get(:internal_id => 3820) 

these don't work:

1.9.3p448 :007 > customer = netsuite::records::invoice.get(:internal_id => 7996)  httpi request webservices.netsuite.com (net_http) httpi post request webservices.netsuite.com (net_http) netsuite::recordnotfound: netsuite::records::invoice options={:internal_id=>7996} not found     /users/pkatepalli/.rvm/gems/ruby-1.9.3-p448/gems/netsuite-0.2.0/lib/netsuite/actions/get.rb:73:in `get'     (irb):7     /users/pkatepalli/.rvm/gems/ruby-1.9.3-p448/gems/railties-3.2.12/lib/rails/commands/console.rb:47:in `start'     /users/pkatepalli/.rvm/gems/ruby-1.9.3-p448/gems/railties-3.2.12/lib/rails/commands/console.rb:8:in `start'     /users/pkatepalli/.rvm/gems/ruby-1.9.3-p448/gems/railties-3.2.12/lib/rails/commands.rb:41:in `<top (required)>'     script/rails:5:in `require'     script/rails:5:in `<main>'  1.9.3p448 :008 > customer = netsuite::records::salesorder.get(:internal_id => 7996) httpi request webservices.netsuite.com (net_http) httpi post request webservices.netsuite.com (net_http) netsuite::recordnotfound: netsuite::records::salesorder options={:internal_id=>7996} not found     /users/pkatepalli/.rvm/gems/ruby-1.9.3-p448/gems/netsuite-0.2.0/lib/netsuite/actions/get.rb:73:in `get'     (irb):8     /users/pkatepalli/.rvm/gems/ruby-1.9.3-p448/gems/railties-3.2.12/lib/rails/commands/console.rb:47:in `start'     /users/pkatepalli/.rvm/gems/ruby-1.9.3-p448/gems/railties-3.2.12/lib/rails/commands/console.rb:8:in `start'     /users/pkatepalli/.rvm/gems/ruby-1.9.3-p448/gems/railties-3.2.12/lib/rails/commands.rb:41:in `<top (required)>'     script/rails:5:in `require'     script/rails:5:in `<main>'  1.9.3p448 :009 > customer = netsuite::records::cashsale.get(:internal_id => 7996) httpi request webservices.netsuite.com (net_http) httpi post request webservices.netsuite.com (net_http) netsuite::recordnotfound: netsuite::records::cashsale options={:internal_id=>7996} not found     /users/pkatepalli/.rvm/gems/ruby-1.9.3-p448/gems/netsuite-0.2.0/lib/netsuite/actions/get.rb:73:in `get'     (irb):9     /users/pkatepalli/.rvm/gems/ruby-1.9.3-p448/gems/railties-3.2.12/lib/rails/commands/console.rb:47:in `start'     /users/pkatepalli/.rvm/gems/ruby-1.9.3-p448/gems/railties-3.2.12/lib/rails/commands/console.rb:8:in `start'     /users/pkatepalli/.rvm/gems/ruby-1.9.3-p448/gems/railties-3.2.12/lib/rails/commands.rb:41:in `<top (required)>'     script/rails:5:in `require'     script/rails:5:in `<main>' 

this works:

1.9.3p448 :010 > customer = netsuite::records::customer.get(:internal_id => 7996) httpi request webservices.netsuite.com (net_http) httpi post request webservices.netsuite.com (net_http) 

you can't pull transaction record – have pull specific type or transaction record. types include: invoice, salesorder, , cashsale.

try going following url:

https://system.netsuite.com/app/accounting/transactions/transaction.nl?id=3820

this should give idea of transaction type record is. if it's invoice, retrieve using:

netsuite::records::invoice.get(1234) 

here rough notes on ns transaction flow. of might specific our instance, majority of applies ns whole , might helpful or others trying piece how ns works.

  • most of time every cashsale (cs) , invoice, has sales order (so) associated it. in case of recurring charge (like monthly service fee) cs or invoice not have have associated it
  • a can either have sales paid order or invoice associated it. ex: if paid on spot cc, generates "cash sale"
  • a so, cs order, , invoice have similar data have unique ns ids. aren't different views of same data ala contact vs customer view on same ns id.
  • a never progress past "billed" state after full payment has been made
  • transactions flow. each record represents semantically. therefore, in normal flow of business, 1 might generated consequense of another. so, sales order means, sales person on phone person , ordered if company pay later when gets "billed" generates invoice, statement requesting payment goods/services

Comments

Popular posts from this blog

php - SPIP: From Tag directly to an article -

jquery - isAjaxRequest always return false -

ruby on rails - In a controller spec, how to find a specific tag in the generated view? -