Skip to main content
Question

How to Skip Cents for Specific Quantity Values

  • July 25, 2025
  • 3 replies
  • 69 views

Forum|alt.badge.img+3

Hi Community,

I’m using a Generic Inquiry (GI) and I’ve written a formula to add slight randomization to a calculated amount using the last 3 digits of CustomerID. The formula works fine, except when Quantity = -1 in those cases, I want to skip the random cents and keep the values as-is.

 

=Switch(    [ARTran.Qty] = -1, -1, Round(            ([ARTran.Qty] * IIf([ARTran.DrCr] = 'D', -1, 1) * 2) +             (((CInt(Right(CStr([ARTran.CustomerID]), 3)) % 99) + 1) / 100.0),            2        ))

 

Can you any one guide please 

3 replies

Neil Cantral
Jr Varsity I
Forum|alt.badge.img+3
  • Jr Varsity I
  • July 25, 2025

Your formula appears to be working, but are you hitting the correct fields in your calculation? I’m assuming you want to be calculating off of TranAmt, not Qty.

=Switch([ARTran.Qty] = -1, [ARTran.TranAmt], 
Round(([ARTran.TranAmt] * IIf([ARTran.DrCr] = 'D', -1, 1) * 2) + (((CInt(Right(CStr([ARTran.CustomerID]), 3)) % 99) + 1) / 100.0),2)
)

Out of curiosity, what’s this being used for?


Forum|alt.badge.img+3
  • Author
  • Captain I
  • July 28, 2025

Yes I am hitting the corrected fields of ARTran.QTY. and -1 is adding cents

 


Chris Hackett
Community Manager
Forum|alt.badge.img
  • Acumatica Community Manager
  • September 25, 2025

Hi ​@tahayabali were you able to find a solution? Thank you!