<@UFAHSLYJ1> It is the right solution if you reall...
# suitescript
a
@Craig It is the right solution if you really need the ID, but you have access to the record object so you may not need the ID at all...
c
I need the search because I need to know what income account or COGS account I need to put in debit or credit
a
What do you need to search exactly?
c
Searching for the income account of each line item in the cash sale, invoice, or customer credit
Otherwise I'd have to iterate through each item and I'd hit a governance limit.
a
You have access to the record...
Copy code
/**
 *
 * Custom GL Plugin Entry Point.
 *
 * @param  {Object} oRec
 * @param  {Object} oStdLines
 * @param  {Object} oCustLines
 * @param  {Object} oBook
 */
function customizeGlImpact(oRec, oStdLines, oCustLines, oBook) {
c
yeah that;s true
a
you can iterate over the lines of the record the GL plugin is running...
c
but I don't want to do record.load for reach line item
a
Why would you need a record load?
if the account information is at the line level you get it from there, if the account information is at the item level you build an array of Items IDs and make one search to get what you need from the items...
c
Yeah that actually sounds good
I inherited this and just kept with the original solution
but maybe that's a really good refactor
So this would be the array option with an 'anyof' search filter
a
yep