Skip to main content
Answer

How to get the Acumatica not SQL GL account code in a GI

  • June 29, 2022
  • 2 replies
  • 94 views

wfilipiak67
Captain II
Forum|alt.badge.img+3

Hi, I am doing a GI to show the GL accounts for NonStock Items.
The NS Items are tied to a posting class. The posting class can use the default of Inventory Item (I) or Posting Class (P) 
I am trying to get the GL account to be in one column. 
My data field looks like this: 
=iif ( [INPostClass.InvtAcctDefault]='I', [InventoryItem.InvtAcctID], [INPostClass.InvtAcctID])
The GI is returning 2037 instead of the GL#, 11302. 

Is there a function or a way to get the 11302( The GL from the chart of accounts) to display? 

Thank you, 
Bill


 

Best answer by nhatnghetinh

Hi wfilipiak67,

I think ‘2037’ is AccountID and ‘11302’ is AccountCD. So you need to do left join with Account (PX.Objects.GL.Account) to get AccountCD. 

  • RELATIONS TAB: Left join [InventoryItem.COGSAcctID] = [InventoryItem.AccountID]
  • RESULTS GRID: Expense Account: iif ( [InventoryItem.COGSAcctID] = [Account.AccountID], [Account.AccountCD], null)

Please see the attachment for more details.

NNT

2 replies

wfilipiak67
Captain II
Forum|alt.badge.img+3
  • Author
  • Captain II
  • June 29, 2022

Here is the GI


nhatnghetinh
Captain II
Forum|alt.badge.img+11
  • Captain II
  • Answer
  • July 1, 2022

Hi wfilipiak67,

I think ‘2037’ is AccountID and ‘11302’ is AccountCD. So you need to do left join with Account (PX.Objects.GL.Account) to get AccountCD. 

  • RELATIONS TAB: Left join [InventoryItem.COGSAcctID] = [InventoryItem.AccountID]
  • RESULTS GRID: Expense Account: iif ( [InventoryItem.COGSAcctID] = [Account.AccountID], [Account.AccountCD], null)

Please see the attachment for more details.

NNT