How is an image file linked to a item
# ask-stanley-ai
r
How is an image file linked to a item
c
AI generated answer (using internal Slack threads):
To link an image file to an item in NetSuite, you can use the
ItemImage
table in SuiteQL. Here is a sample query that was shared in the conversations:
Copy code
sql
SELECT
    ItemImage.Item,
    ItemImage.Name,
    ItemImage.AltTagCaption,
    ItemImage.SiteList,
    File.CreatedDate, 
    File.LastModifiedDate, 
    File.FileType, 
    File.FileSize, 
    File.URL,
    MediaItemFolder.AppFolder
FROM
    ItemImage
    INNER JOIN File ON
        ( File.Name = ItemImage.Name)
    INNER JOIN MediaItemFolder ON 
        (MediaItemFolder.id = File.Folder) 
WHERE
    ( Item = 1671 )
This query joins the
ItemImage
,
File
, and
MediaItemFolder
tables to get the image details for a specific item. Please replace
1671
with your specific item ID. For adding the item image on a PDF, you can refer to SuiteAnswer 45132. However, please note that loading the images every time someone interacts with it while on the form is likely to have significant performance drawbacks. If you want to source the value from an item (type: image) onto the transaction line items, you might want to consider using a custom link field instead. Then, you can use some logic to get it into the viewable link on your PDF. ****** 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.823191583
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.821180046
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.817849398
Please provide your feedback on this answer.