does anyone knows how to verify what is the GL Acc...
# suitescript
e
does anyone knows how to verify what is the GL Account used by an item on transactions? Is there any helpful setup or a saved search? I need to know this before saving the transaction
a
you would want to look at the Accounts set-up on the item...
meaning that it would be an item search for relevant accounts
e
yeah, I know that there is the accounting subtab on the items, the thing is that for example for inventory item the subtab has: COGS Account, asset account, income account, gain/loss account, etc. does the account used on the GL Impact depends on the type of transaction?
e
nlapiLookupField('item', 333, 'incomeaccount')
e
Not all the items has an incomeaccount, others only have expense account.
a
hmm... sounds like you will have to handle it within your code with switch - case. If txn = 'itemfulfillment', use COGS, txn = 'itemreceipt' use blah and so on... I thought i saw the expected GL impact for each txn in Help somewhere but can't find it now. Perhaps your Accountants can help with that...
e
@eminero you can grab an array of fields, and for those where the values come back with data in, you can decide what you want to do with it at that point. My response was an example of what you could do to start you off.
e
@ERP Experts thanks for your reply, that should be a good start, it ended up that only expense accounts should be validated. The requirement was not clear at the beginning but thanks for all your replies!
e
You're welcome @eminero 🙂