N/query question What fields are NOT supported? I ...
# suitescript
d
N/query question What fields are NOT supported? I tried to create a simple query but it returned errors every time I tried to include an image field in the results. And the * didn't return that field either. Is there a way to return the URL of an image field using N/query?
s
Not sure the list of what’s not supported. I just ran into this similar problem trying to get the image filename from a field on the item record, the only solution I could find was using a combo of lookupfields and Query:
Copy code
var fieldLookUp = search.lookupFields({
    type: search.Type.INVENTORY_ITEM,
    id: item_id,
    columns: ['name','internalid', 'custitem_atlas_item_image']
});


var img_id=  fieldLookUp.custitem_atlas_item_image[0].value //7493

var queryResults = query.runSuiteQL(
    {
        query: "SELECT  name, filetype FROM file WHERE id = "+ img_id
    }
)
var imgq = queryResults.asMappedResults();
var img_filetype = imgq[0].filetype
var img_name = imgq[0].name
I think with the search module you could get the URL from the value of the image field on the record.
d
Yah, I resorted to using the search module but I would much rather use a query.