In suite commerce advanced (SCA) I need to create ...
# ask-stanley-ai
m
In suite commerce advanced (SCA) I need to create an extension to read a customer field after login. How can I get this field in the extension ?
c
AI generated answer (using internal Slack threads):
To access a customer field within a SuiteCommerce Advanced (SCA) extension, you can use the
Profile.Model
to get the customer's profile information. The
Profile.Model
is a backbone model that contains the customer's profile data. Here is a sample code snippet on how you can use it:
Copy code
javascript
var profile = Profile.Model.getInstance();
var category = profile.get('category');
In this code,
Profile.Model.getInstance()
is used to get the instance of the customer's profile. Then, the
get
method is used to retrieve the value of the 'category' field. Please note that the field name should match exactly with the field name in the customer record in NetSuite. If the field is not available in the
Profile.Model
, you might need to customize the
Profile.Model
to include this field. ****** Disclaimer: This response was generated by an artificial intelligence assistant based on previous conversations from multiple Slack channels, and may contain inaccuracies or mistakes. ******
Slack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.824127078
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.811526716
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.809352636
Please provide your feedback on this answer.