I have a applicationDocuments customization as I w...
# suitecommerce
c
I have a applicationDocuments customization as I want to retrieve all documents related to the company and current website. Just regular parameters to a search. Though no matter what I try, all my searches result in UNEXPECTED_ERROR even though they work fine from within NetSuite. Is it not possible to search from a applicationDocuments service controller?
s
What's an applicationDocuments customisation and applicationDocuments service controller?
c
ah yeh, that's probably the name that the builder choose for it. I'm trying to make sense of it. It's a extension to show documents within the MyAccount. Does the following snippet helps?
define("CA.ApplicationDocuments.ApplicationDocuments.ServiceController", [
"ServiceController",
"Application",
"Configuration",
"Models.Init",
"underscore"
], function (ServiceController, Application, Configuration, ModelsInit, _) {
"use strict";
return ServiceController.extend({
name: "CA.ApplicationDocuments.ApplicationDocuments.ServiceController",
s
Kinda, at least I now understand that its name is only relevant to your customisation, rather than some aspect of the application I've never heard of before. If you've scripted a search that fails in SuiteCommerce but not the NetSuite UI then I probably say that roles and permissions are the most likely suspects. For example, you're requesting access to records that the user does not have access to. If the user is required to log in before accessing them, they will need their role customised to be able to read those records; if anonymous access is supported you will need to elevate permissions on the service file and enable the special access controls for anonymous access.
c
Thanks, I will look into that
l
Hi @Christiaan, This is a known issue—*applicationDocuments service controllers* can be sensitive to search filters, especially with custom parameters like website or company. While it works in the NetSuite UI, the same search might throw
UNEXPECTED_ERROR
due to context, permissions, or missing field exposure in the service layer. We’ve resolved this before by adjusting filters or creating a custom Suitelet or service controller to safely return the desired documents. Happy to help you fix or extend this—feel free to reach out: https://lstconsultancy.com/contact/ or email me at suraj.tambe@lstconsultancy.com.