jacobsvante / netsuite-rs

Rust library for making requests to the NetSuite REST APIs
https://crates.io/crates/netsuite
MIT License
3 stars 1 forks source link

not all the fields fetched #11

Closed kraftaa closed 7 months ago

kraftaa commented 7 months ago

hi, I'm comparing the fields chich I'm getting via airbyte (Very slow) , cdata jdbc driver and netsuite-rs. airbyte & jdbc driver are getting fields which are populated but I can't fetch them with netsuite-rs (it's not parsed json , just float fields) but I'm getting error that such a key doesn't exist.

for example all fields aging,aging1,aging2,.. https://www.netsuite.com/help/helpcenter/en_US/srbrowser/Browser2017_2/schema/record/customer.html

I understand they are calculated(?) but I get them from both airbyte and jdbc, what do I need to change to get them too?

I see it follows https://docs.axway.com/bundle/Amplify_Integration_Builder_allOS_en/page/netsuite_restlets_api_documentation.html but curious how to get other fields.

thank you

jacobsvante commented 7 months ago

Look through the entire response. The fields might be named differently than what the others return. E.g. custbody_xyz.

Using the built in openapi schema browser might help you. From terminal, run: netsuite -l debug rest-api openapi-serve customer

Then visit http://127.0.0.1:8000/ in browser.

kraftaa commented 7 months ago

thank you! yes I've realized why : the fields are in schema which i'm getting via api.metadata.jsonschema("customer"); but because the response is jsonb blob, it's not in every record, so I was getting an error with my struct.

I've tried running the command

netsuite --all-features  rest-api --account "..." --consumer-key "..." \
        --consumer-secret ".." --token-id ".." \
        --token-secret ".." jsonschema Customer

but getting unauthorized response even if I'm getting everything normally if run from rust. Do you know what I need to enable in netsuite permissions for that?

thank you!

jacobsvante commented 7 months ago

Sorry but you'll have to Google that on your own. Something like "Netsuite REST API token permissions"

kraftaa commented 7 months ago

@jacobsvante the command which you provided as well as api.metadata.jsonschema("customer"); are returning fields but they are not present in fetch_all response, I've checked fetch_values too. - I was not parsing just loading everything. The reason is I believe due to calculated fields

Listing application data from custom fields is not supported with Analytic APIs. 
For example, if you run a SuiteQL query  on a custom transaction body field, 
it will not return any information from its corresponding subtabs in the UI.
 For more information about custom fields, 
see [Custom Fields](https://docs.oracle.com/en/cloud/saas/netsuite/ns-online-help/chapter_N2826978.html).
jacobsvante commented 7 months ago

SuiteQL (which you seem to be using) and REST API (which is what the jsonschema is for) are two different things. Please understand that this is not a support forum.