What causes a suitelet to return 'There are no rec...
# ask-stanley-ai
r
What causes a suitelet to return 'There are no records of this type' when the data is clearly visible while debugging
c
AI generated answer (using internal Slack threads):
The error message 'There are no records of this type' in a Suitelet can be caused by several reasons. One common reason is that the Suitelet is not marked as 'released' in the environment where it is being executed. Another reason could be related to access permissions. For instance, if the Suitelet is trying to access a custom record type, and the role executing the Suitelet does not have the necessary permissions to access that custom record type, it could result in this error message. In the context of redirecting to a Suitelet from a workflow action script, the error could be due to the way the Suitelet is being called or the parameters being passed. If the Suitelet requires a record ID as a parameter and it is not being passed correctly, it could result in this error. Here is a sample code snippet from the conversations that shows how to redirect to a Suitelet from a workflow action script:
Copy code
code
function goToSuitelet(context) {
    var script_id = parseInt(runtime.getCurrentScript().getParameter('custscript_go_to_suitelet_script_id'));
    var deployment_id = parseInt(runtime.getCurrentScript().getParameter('custscript_go_to_suitelet_deployment_id'));
    var deployment_id = 1;
    var params = {txid: context.newRecord.id};

    redirect.toSuitelet({scriptId: script_id, deploymentId: deployment_id, parameters: params});
}
In this code, the Suitelet script ID and deployment ID are passed as parameters to the
redirect.toSuitelet
function, along with the record ID. If these parameters are not passed correctly, it could result in the 'There are no records of this type' error. ****** 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.804722667
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.804648697
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.804458201
Please provide your feedback on this answer.
Thank you for your feedback