Is there a list of supported fields that can be fe...
# suitecommerce
m
Is there a list of supported fields that can be fetched using the
getFieldValues()
method on a customer shopping object? Also, Is there a way to load a field that isn’t included in that list?
s
I don't think we have a list. The Commerce API is there, in part, to streamline getting the customer fields we think a web store would need
The alternative would be standard SuiteScript
m
Good to know. Thanks!
s
You can log the user profile to the console to see all the fields we think you'll need. You can try to fetch other values and see if they're returned, but I honestly can't say which ones will work and which ones won't
👍 1
k
@Mark In my experience, you can only fetch the fields that are documented in the Commerce API. The Commerce API lists the json object properties, and I recall the field names that are supported by getFieldValues() are the property names of these JSON objects. To be sure, I suggest calling the method without arguments and use JSON.stringify() to log them to the SSP execution log. The output will show the names
m
Thanks @Keith Fetterman. I don’t see my field there so I will have to load it via a different method
k
When you use SuiteScript, you may run into a permissions issue depending on what field you need because it needs to be accessible via the Shopper or Customer Center role.
m
Yeah I believe that is what I’m experiencing currently. I’m assuming there is no way to modify the Commerce API json either.
k
No. I have fought with that API since the beginning of time. I hope NetSuite will deprecate it and use standard SS 2.0 in the future.
m
Yes SS 2.0 would be a great upgrade. For now I will look for a workaround. Thanks!
k
If you are running into a permissions issue, the easiest thing to do is create service controller and a separate model then call the service to retrieve the extra data. It greatly simplifies configuring extended permissions because you can create a custom role with the permissions you need and assign it to the service controller.