Hi Everyone, I am facing an issue with my SCA exte...
# suitecommerce
s
Hi Everyone, I am facing an issue with my SCA extension where, when i try to get the customer record custom field using ProfileModel.getInstance().get('custom_field'), the data is not showing up in the frontend when testing locally. Upon checking the value for the field I am trying to get, the logs show it as undefined. Can anyone tell me the correct method to fetch a custom field from the customer record and show it in the frontend template in extension development tool.
s
What version of SCA are you using? Since 2019.1, we automatically fetch custom entity fields and return them part of the
customfields
array.
(If you're using a version prior to 2019.1, you basically just need to add
profile.customfields = ModelsInit.customer.getCustomFields();
to your backend Profile model.)
s
Hi, Thankyou for the response. I am using SCA version 21.2. Is the customfields array a member of userprofile model? How can we access it in the frontend. Looking forward to your response.
s
Have you made your custom entity field available to Web Site? As in you ticked the checkbox?
s
Hi Thank you for your response. With your help I was able to get the custom fields. I am trying to fetch a field named "category" from the customer record. I believe it is not a custom field. And the profile model does not contain this field. Could you guide me regarding how i will be able to fetch this particular field. Looking forward to your response.