Solved

IF Statement in GI

  • 13 December 2023
  • 6 replies
  • 141 views

Userlevel 2
Badge

Hi,

 

Trying to build out a GI and needing some help on an IF statement.

 

Here’s the scenario. 

If Qty in APTran more than 0 (red check), it will return data Inventory acc ID (yellow checks) else will return AP Acc ID (Blue Check).

 

So, here is my formula:

Receipt Account=IIf( [APTran.Qty]>0,[InventoryItem.InvtAcctID], [APTran.AccountID])

 

and  when applied it on Receipt Account field, it revert to “something else” value which shown above did not return as well as they taken individually.

 

Need your advice on this problem.

Thank you in advance.

icon

Best answer by Naveen Boga 13 December 2023, 12:38

View original

6 replies

Userlevel 7
Badge +8

Set your schema field on Receipt Account to APTran.AccountID. 

 

Let us know the results. 
If more help is needed upload your GI’s XML here and we can assist further.  
 

This happens because the column is returning the Account’s ID rather than the Accounts CD.  Setting the schema field lets Acumatica know the format of your result and will correctly translate the ID → CD

Userlevel 7
Badge +17

@satwikh1  Please share your XML format of your GI here. 

Userlevel 2
Badge

Hi all,

 

Thanks for your reply. 

applied APTran.AccountID on Schema Field also produce the same result.

please find attached the XML for further assist.

 

 

Userlevel 7
Badge +17

@satwikh1  I have modified your GI by adding additional JOINS. Now, it is showing the right Receipt Account based on the conditions. Please find the attached GI here.

 

 

Userlevel 2
Badge

@satwikh1  I have modified your GI by adding additional JOINS. Now, it is showing the right Receipt Account based on the conditions. Please find the attached GI here.

 

 

Now it’s worked well, with simple modification. Thanks @Naveen Boga  

Userlevel 7
Badge +17

@satwikh1  Great :) Thanks for sharing the update.

Reply


About Acumatica ERP system
Acumatica Cloud ERP provides the best business management solution for transforming your company to thrive in the new digital economy. Built on a future-proof platform with open architecture for rapid integrations, scalability, and ease of use, Acumatica delivers unparalleled value to small and midmarket organizations. Connected Business. Delivered.
© 2008 — 2024  Acumatica, Inc. All rights reserved