ANS-1562 · CUSTOM FIELDS, RECORDS & FORMS

How to Display Images at the Line Level in NetSuite Transactions?

Learn how to embed dynamic image links directly within line-item fields on NetSuite records using custom formula fields.

Short answer

To display images at the line level in NetSuite, create a custom Formula (HTML) or Formula (Text) field. Within this field, construct an HTML <img> tag, concatenating the image URL from a custom column field. This method allows for dynamic image display based on line-item data, ensuring the image source is a fully qualified URL.

Scenario

Users need to display product images or other relevant visuals directly on transaction line items within NetSuite records. The challenge is to dynamically generate an HTML tag that sources an image URL from a custom field associated with each line.

Solution

To display images at the line level, a custom field of type Formula (HTML) or Formula (Text) can be configured to output an HTML tag. This approach involves pre-constructing the HTML within the formula field and concatenating the image source URL.1. Create a custom transaction line field (e.g., custcol_image_line) to store the image URL for each line item. This field should contain the full, valid image URL, which often requires the NetSuite domain and the image's internal ID (e.g., https://system.netsuite.com/core/media/media.nl?id=).

  1. Create another custom transaction line field of type "Formula (HTML)" or "Formula (Text)".

  2. In the "Formula" field, enter the following expression. This formula constructs an tag, using TO_CHAR to ensure the output is treated as a character string for display, and dynamically inserts the image URL from the custcol_image_line field.

TO_CHAR('<img src="'||{custcol_image_line}||'" border="0" width="200" height="200">')

This formula will render an image with a border of 0 pixels, and dimensions of 200x200 pixels, sourcing its content from the URL provided in the {custcol_image_line} field.

Expert NetSuite Support

Need help with this NetSuite issue?

Custom Fields, Records & Forms consulting and configuration support

Talk to a consultant