Hi Everyone I am currently working on creating an ...
# suitecommerce
s
Hi Everyone I am currently working on creating an extension using extension dev tool 24.1.2. Currently, I want to fetch the user profile data for the extension. I am using Profile.Model to get the appropriate user information. However, I want to fetch a field from customer record named "category". I believe this is a native field but for some reason I am not able to fetch this field using the user profile model. Does anyone know how i will be able to fetch this field from the customer record? Looking forward to your response.
s
Use the Commerce API - use getFieldValues(), specifying 'category' as the field you want https://docs.oracle.com/en/cloud/saas/netsuite/ns-online-help/section_N2503226.html#bridgehead_4479558894
This is an example for custom fields, but you could modify it for standard fields https://developers.suitecommerce.com/expose-custom-field-data-to-the-frontend.html#include-the-custom-field-in-the-request
a
Oh that makes sense, Profile is more about stuff related to the user, less about the record and its fields, correct?
🤔 1
s
Well, it's about the right context and using the right tools for the job.
We have a specific API for 'customer data' as well as an existing data model for the 'customer profile'. So, it seems to me prudent to find the right way to leverage those for what you want.