hi team :wave: posting here as well - related to t...
# suiteql
c
hi team 👋 posting here as well - related to this post: https://netsuiteprofessionals.com/blog/question/suiteql-is-there-a-jointure-table-between-item-and-customfield/ hoping to get a quick answer 🙏 i'm looking for a way to retrieve the item custom fields' value, especially when their type is image i can find the related value within the `file`table, i can find the related custom field within the
customfield
table, but i'm missing the jointure between item, customfield & file hope there's a positive answer i did not find yet 🤞
a
I do not understand what the end goal is here.... you want a query that shows... internal ids for file records stored in a custom image field on a item record?
c
@Anthony OConnor, this is correct
there's this field,
storeDisplayImage
that works fine: i can find the file's internal id & apply the join - but the the other custom fiels like
CUSTITEM_CUSTOM_ALTIMAGE1
, it's not present in the item record
a
right, so I think you are right about the data type being the issue... if its just a link to the file then it will return the file.id but the data type for storeDisplayImage is INTERGER for actual IMAGE data... I'd imagine what is stored is the binary blob data of the image, and not sure what use that would be in a query result so NS just doesn't provide access to it.
huh yeah this is just dumb.. it literally saves it exactly like the other field, its the internal id of the file in the file cabinet... but apparently you dont have access via query
The SQL error is pretty explanatory though...
c
i wish to have received this kind of error earlier - here is what i receive
Copy code
"detail": "Invalid search query. Detailed unprocessed description follows. Search error occurred: Unknown identifier 'CUSTITEM_CUSTOM_ALTIMAGE1'. Available identifiers are: {item=item}.",
            "o:errorQueryParam": "q",
            "o:errorCode": "INVALID_PARAMETER"
when running for instance
Copy code
SELECT CUSTITEM_CUSTOM_ALTIMAGE1 FROM item WHERE id = 1012
a
I don't know what benefit having a custom image field is over having a custom field of List/Record type that stores an integer file.id could you potentially create another custom field of list/record type and then copy the values from the Image field into that field via CSV, and then have a UE script that keeps them synched - no idea what the broader context is so no idea if that is useful
yeah when building SQL queries I find its best to just start with a SELECT x FROM y with no WHERE and just validate all your column names. if you're doing joins to other tables do simple SELECT a FROM b queries on those tables before you start trying to join or aggregate data
c
ok, but I mean I'm not able to get the same error as the one you get
a
umm i think you need the
item.
before it
1
item.CUSTITEM_CUSTOM_ALTIMAGE1
j
can you post your whole SQL?