Hi @jyounes! For this issue the GLTran.AccountID is actually not the AccountCD, this is a common misstep in creating calculations on ID fields.
Often the UI will switch the ID to the CD value so you can more easily understand what the value represents, but in this case the GLTran.AccountID is the numerical representation of the AccountCD, so it’s always false since you probably don’t have an account with the ID of 0500.
Try adding the =hGLTran.AccountID] field to the GI results to see the ID value of the account you’re looking to create the calculation on, then use this number instead of the 0500
The AccountID is in fact the system internal ID the way you use. You will need to Join GLTran with Account ON GLTran.AccountID = Account.AccountID and then use Account.AccountCD in your formula
The AccountID is in fact the system internal ID the way you use. You will need to Join GLTran with Account ON GLTran.AccountID = Account.AccountID and then use Account.AccountCD in your formula
Added the PX.Objects.GL.Account table and joined it the relations tab. Added accountCD to the inquiry and referenced it in my formula and now I get the correct results.
UPDATED FORMULA
= IIf( IGLAccount.AccountCD] = '0500', ( (,GLTran.CreditAmt] *.5) - ()GLTran.DebitAmt] ) *.5) , ()GLTran.CreditAmt] *.75) - ()GLTran.DebitAmt] ) *.75 )