Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add to_xml method to access raw response body #330

Open
greggroth opened this issue Mar 24, 2017 · 2 comments
Open

Add to_xml method to access raw response body #330

greggroth opened this issue Mar 24, 2017 · 2 comments

Comments

@greggroth
Copy link
Contributor

greggroth commented Mar 24, 2017

I have a need to access the raw XML body(1) and am right now getting to it by calling a private method:

xml = NetSuite::Actions::Get.new(NetSuite::Records::TransferOrder, {
  internal_id: 123
}).send(:request).xml

I'd love a public interface for getting the raw XML.

Footnotes:

  1. For additional context, I have a service that checks for updated records and posts these records to an SNS topic with the XML record.
@iloveitaly
Copy link
Member

iloveitaly commented Mar 24, 2017

I'm all about. Submit a PR and let's get it in :)

btw, https://github.com/netsweet/netsuite_rails which is horribly documented has a pretty advanced polling service to manage consuming updates from netsuite for many record types. I bet you already have your system built, but in case you don't, l'd check it out!

@fabiensebban
Copy link
Contributor

Hi @greggroth and @iloveitaly,
I tried to call a nestuite action to get the response using the UpserList action:

cash_sales  = [] # Array that contains multiple cash sale objects
NetSuite::Actions::UpsertList.new(NetSuite::Records::CashSale, cash_sales).send(:request)

I always get the following error:

NoMethodError (undefined method `to_record' for NetSuite::Records::CashSale:Class)

How can I call the UpsertList action and get the NetSuite response?
Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants