Ajith Kumaran
01/02/2025, 1:39 PMCeligo AI
01/02/2025, 1:39 PMAI generated answer (using internal Slack threads):To determine whether the logged in user is an individual or a company using the SuiteCommerce Frontend Extensibility API, you would need to access the customer information within an extension. You can use the
Profile.Model
to access the customer's information. However, the specific field to determine whether the user is an individual or a company may vary depending on your NetSuite setup.
For example, if you have a custom field that specifies whether the customer is an individual or a company, you can access this field using the Profile.Model
.
Here is a sample code snippet on how you can access the customer's information:
javascript
define('MyExtension.Profile.Model.Extension', ['Profile.Model'], function(ProfileModel) {
'use strict';
_.extend(ProfileModel.prototype, {
// Override the get function to add your custom field
get: _.wrap(ProfileModel.prototype.get, function(fn, attr) {
if (attr === 'customField') {
return this.attributes.customField;
}
return fn.apply(this, _.toArray(arguments).slice(1));
})
});
});
In this code snippet, replace 'customField'
with the actual field id that specifies whether the customer is an individual or a company.
******
Disclaimer:
This response was generated by an artificial intelligence assistant based on previous conversations from multiple Slack channels, and may contain inaccuracies or mistakes.
******Celigo AI
01/02/2025, 1:39 PMSlack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.779369473
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.770909965
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.765612
Celigo AI
01/02/2025, 1:39 PMAjith Kumaran
01/02/2025, 1:48 PMCeligo AI
01/02/2025, 1:57 PMrico
01/03/2025, 3:04 AM