cweier
04/22/2025, 2:20 AMCeligo AI
04/22/2025, 2:20 AMAI generated answer (using internal Slack threads):The issue of 'An unexpected error has occurred' when attempting to view an image from the File Cabinet which has 'Available without Login' enabled can be due to several reasons. Here are some potential solutions based on the conversations: 1. URL Structure: The structure of the NetSuite image file URL might be causing the issue. A standard image URL that ends in .png or .jpg is usually handled fine. Make sure the URL is correctly structured. 2. Company-Wide Usage: As of NetSuite 2019.2, a new 'Company-Wide Usage' box has been added to the file cabinet record. This controls the level of permission given to a specific file in the file cabinet. Check the 'Company-Wide Usage' box to make an image available in a printing template while preventing unauthorized access to the image file through the internet. 3. FreeMarker Directive: If you edit templates in source code, a new
@filecabinet
FreeMarker directive is now available to reference files directly from the file cabinet. You can use this directive to embed text, images, and fonts that are stored in the file cabinet into the template.
4. File Type: The 'Company-Wide Usage' and the @filecabinet
directive only works on images, text files, and fonts. PDFs or other file types are not supported with this checkbox.
5. Base64 PNG Image: If you're fetching a Base64 PNG image from a remote API and saving it to the file cabinet, make sure it's decoded correctly in SuiteScript 2.0 so the image works within the PDF.
6. Escaping the URL: For N/render, make sure you escape the URL.
Remember, if the file is generated via script, you likely can't use 'Company-Wide Usage'. Also, be aware of potential privacy issues with the file content if it's set to 'Available Without Login'.
******
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
04/22/2025, 2:20 AMSlack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.816178381
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.809395969
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.808946908
Celigo AI
04/22/2025, 2:20 AM