In this script: const docStructTask = task.create(...
# ask-stanley-ai
a
In this script: const docStructTask = task.create({taskType: task.TaskType.DOCUMENT_CAPTURE}); docStructTask.inputFile = requestFile; const outputFileName = (new Date()).getTime() + `_${requestFile.name}`; docStructTask.outputFilePath = `/AJM Async PDF Extraction Results/${outputFileName}.json`; I get this error: Folder does not exist or you don't have access to the folder. Why? The folder I told it to use is one I created, I'm logged in with Admin role, and the script deployment runs with Current Role.
c
AI generated answer (using internal Slack threads):
Based on the conversations, the error "Folder does not exist or you don't have access to the folder" could be due to the following reasons: 1. The role you are using does not have the necessary permissions to access the SuiteScripts folder. Even if you have all SuiteScript and Documents permissions, if the role does not have access to the specific folder, you will not be able to access it. 2. There could be restrictions set on the SuiteScripts folders/subfolders. If an Admin has restricted the roles on the folder directly, it could prevent you from deploying your script. 3. The issue could also be related to the asynchronous nature of the
task.create
method. If the task is not complete before you try to access the file, it could result in an error. You could use the
task.checkStatus
method to check the status of the task before trying to access the file. To resolve this issue, you could try the following: - Check the permissions of your role and ensure it has access to the SuiteScripts folder. - Check if there are any restrictions set on the SuiteScripts folders/subfolders and remove them if necessary. - Use the
task.checkStatus
method to ensure the task is complete before trying to access the file. Remember, these are just possible solutions based on the conversations provided. The actual solution may vary depending on the specific details of your situation. ****** Disclaimer: This response was generated by an artificial intelligence assistant based on previous conversations from multiple Slack channels, and may contain inaccuracies or mistakes. ******
Slack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.818237424
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.813842833
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.811828732
Please provide your feedback on this answer.
Thank you for your feedback