I'm trying to get transaction data using the N/query module:
require([ 'N/query'],
function(query) {
var trxQuery = query.create({ type: query.Type.TRANSACTION });
trxQuery.columns = [
trxQuery.createColumn({ fieldId: 'externalid' }),
trxQuery.createColumn({ fieldId: 'account' }),
trxQuery.createColumn({ fieldId: 'fxamount' })
];
var results = trxQuery.run();
})
The help says next thing about setting of fieldId in creating the query column:
Obtain this value (fieldId) from the Records Browser.
1. Go to the appropriate record type. 2. Scroll until you see the Search Columns table. 3. Locate the appropriate value in the Internal ID column.
However, I get the following error: {"type":"error.SuiteScriptError","name":"SSS_SEARCH_ERROR_OCCURRED","message":"Search error occurred: Field 'account' for record 'transaction' was not found." ...
The same thing happens for fxamount field.
How can I define query column in order to get data on Account and Amount (Foreign Currency) for transactions by using N/query module?