trying to use hte following. ```search.lookupField...
# suitescript
r
trying to use hte following.
Copy code
search.lookupFields({
    type: record.Type.SALES_ORDER,
    id: createdFrom,
    columns: [ 'subtotal' ],
});
but getting an error
{"type":"error.SuiteScriptError","name":"SSS_INVALID_SRCH_COL","message":"An nlobjSearchColumn contains an invalid column, or is not in proper syntax: subtotal."}
Record Browser shows Sales Order having
subtotal
as a valid field, and loading the record via
record.load()
and then using
.getValue({fieldId: 'subtotal'})
does actually return the value. So what am I missing?
b
N/search matches saved search, while N/record matches individual records in the ui
don't try to troubleshoot using record based method, go to the saved search instead
👍 1
n
Do not look at the "fields" in record browser. lookupFields is based on the search columns. Check the columns under the Transaction in record browser.
👍 1
r
ah ha. that was what i was missing, thank you. Was looking at fields on record browser and completely glossed over the link under search to Transaction