Hello guys!
Hope you all are doing great!
I'm trying to retrieve sublist values using Search module in SuiteScript.
In this example I need to retrieve the "items" sublist fields using the search method. But the 'join' is not working.
Something like that:
``
const pagedPurchaseOrder = Search.create({
type: Search.Type.PURCHASE_ORDER,
filters: [["internalId", Search.Operator.IS, 1585660]],
columns: [
"tranid",
"entity",
"trandate",
"amount",
"total",
"statusref",
"custbody6", // Forma de pagamento
"custbody_sit_transaction_l_cond_pagto",
"custbody_roit_status",
Search.createColumn({
name: "entityid",
join: "vendor",
}),
Search.createColumn({
name: "legalname",
join: "vendor",
}),
Search.createColumn({
name: "internalId",
join: "vendor",
}),
Search.createColumn({
name: "custentity_psg_br_cnpj",
join: "vendor",
}),
Search.createColumn({
name: "address",
join: "vendor",
}),
Search.createColumn({
name: "custentity_o2s_t_conta_corrente_favor",
join: "vendor",
}),
Search.createColumn({
name: "custentity_o2s_t_cod_agencia_favor",
join: "vendor",
}),
Search.createColumn({
name: "custentity_o2s_t_digito_verfic_conta",
join: "vendor",
}),
Search.createColumn({
name: "custentity_sit_codmun",
join: "vendor",
}),
// Search.createColumn({
// name: "name",
// join: "customrecord_sit_municipio",
// }),
Search.createColumn({
name: "custrecord_psg_br_cnpj",
join: "subsidiary",
}),
Search.createColumn({
name: "legalname",
join: "subsidiary",
}),
Search.createColumn({
name: "amount",
join: "item",
}), //Amount from Sublist value
],
}).run();
This is a script in TypeScript and our issue is with:
`` Search.createColumn({
name: "amount",
join: "item",
}),
How could we do this kind of search in sublists?
Thank you!