Milcho Dimkov
11/03/2024, 1:13 PMCeligo AI
11/03/2024, 1:13 PMAI generated answer (using internal Slack threads):Based on the conversations, it seems that the issue you're facing is due to the fact that the Employee Center role doesn't have the necessary permissions to access the 'Lists -> Items' page. This is because client scripts execute as the current user, and thus are subject to the permissions of the role that the user is currently using. One way to work around this issue is to have your client script call a Suitelet that can run as admin to perform the necessary checks. This way, the Suitelet will have the necessary permissions to access the 'Lists -> Items' page, and the client script can then retrieve the results from the Suitelet. Here's a basic example of how you can set this up: Client Script:
javascript
var url = url.resolveScript({
scriptId: 'customscript_my_suitelet',
deploymentId: 'customdeploy_my_suitelet',
returnExternalUrl: true
});
var response = https.get({ url: url });
// Parse the response and perform necessary checks
Suitelet:
javascript
function onRequest(context) {
var itemId = context.request.parameters.itemId;
// Perform necessary checks on the item
context.response.write(JSON.stringify(result));
}
Remember to set the Suitelet to 'Available Without Login' and to run as an admin role in the deployment settings. This way, the Suitelet will be able to access the 'Lists -> Items' page regardless of the role of the user who is executing the client script.
******
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
11/03/2024, 1:13 PMSlack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.850284159
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.848162532
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.847339869
Celigo AI
11/03/2024, 1:13 PM