Hello all, I've created a custom field in commerc...
# suitecommerce
s
Hello all, I've created a custom field in commerce category. But I'm unable to get into website. How to get a custom field in commerce category in to website? Thanks in advance.
s
By default custom fields on your commerce categories may not be included in the call to fetch them. You will need create a SuiteScript file and do something like this:
Copy code
Application.on('after:Category.get', function (CategoryModel, category) {
    var lookupResults = nlapiLookupField('commercecategory', category.internalid, [
        'yourcustomfield'
    ]);
    category.customfield = lookupResults.yourcustomfield
});
👍 2