Aaron McCausland
08/19/2025, 8:43 PMCeligo AI
08/19/2025, 8:43 PMAI generated answer (using internal Slack threads):To get the URL of an image in an image field using SuiteScript, you would typically use the
getValue
method to get the internal ID of the image file. However, this will not give you the URL of the image.
One way to get the URL of the image is to load the file record using the internal ID and then get the URL. Here is a sample code snippet:
javascript
var fileObj = file.load({
id: internalId
});
var url = fileObj.url;
In the above code, internalId
is the internal ID of the image file that you got using getValue
. The file.load
method loads the file record, and fileObj.url
gives you the URL of the image.
Another way to get the URL of the image is to use the getText
method. However, this method may not always be reliable.
For setting an Image type field on an item with a map/reduce SuiteScript, you can use the setValue
method with the internal ID of the image as the value. Here is a sample code snippet:
javascript
record.setValue({
fieldId: 'custitem_image_field',
value: internalId
});
In the above code, custitem_image_field
is the ID of the Image type field and internalId
is the internal ID of the image file.
******
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
08/19/2025, 8:44 PMSlack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.85187006
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.834152
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.793221
Celigo AI
08/19/2025, 8:44 PM