AugForums.com

An Acumatica User Group

  • Free
    • Start Here
    • In-Person Gatherings
    • Power BI Workshop
    • Podcast
    • Rolodex
    • Blog
    • Forums
  • Paid
    • AugSQL
    • GI Course
    • GI Library
    • Consulting
  • Register
Acumatica Forums

By using this website, you agree to our Terms of Use (click here)

Forums
AUG Forums
Everything Else
Using Constants in ...
 
Notifications
Clear all

Questions Using Constants in Functions

 
Everything Else
Last Post by Tim Rodman 8 years ago
2 Posts
2 Users
0 Reactions
3,287 Views
RSS
MichaelHansen
Posts: 149
 MichaelHansen
Topic starter
March 28, 2018 10:57 am
(@michaelhansen)
Estimable Member
Joined: 6 years ago

I have created a new field to calculate commissions for specific buyers for my company. How do I multiply a value by a constant? Everything I am seeing requires a field as a parameter. Here is what I have and what I want:

[PXFormula(typeof(Mult{POReceiptExt.usrCommPcnt, POReceipt.curyOrderTotal}))]  //replaced angle brackets with curly brackets, due to AUG formatting
[PXFormula(typeof(Mult{0.05, POReceipt.curyOrderTotal}))]                      //replaced angle brackets with curly brackets, due to AUG formatting

I have tried casting it into quotes, adding an "m" after the value, etc. But this function appears to only accept table fields. Any thoughts? I need this to execute once and be done, otherwise I'd override a handler like "row updating" or something.

I had previously set usrCommPcnt as a non-persistent value, but then I couldn't release the POReceipt. I'm debating making it a DBColumn just to force this to work, but it feels like bloat that shouldn't be necessary. Anyone know how to toss a constant into things like Mult and Where functions?

The question above is the tip of the iceberg for this issue. What I'm really trying to do is pull the VendorID on a POReceipt, then grab the Buying Agent from the Vendor Table. Once I know the agent, I'm entering a Switch/Case/Where brick to sort out the commission percentages based on the agent. Right now my main issue seems to be avoiding variable bloat and using constants in these functions.


1 Reply
Tim Rodman
Posts: 3204
 Tim Rodman
Admin
March 29, 2018 9:41 pm
(@timrodman)
Famed Member
Joined: 10 years ago

Hmmm, I'd recommend asking this on StackOverflow. Once you cross the line into C# and the Framework, I'm pretty useless.

https://stackoverflow.com/questions/tagged/acumatica


Reply
Forum Jump:
  Previous Topic
Next Topic  
Forum Information
Recent Posts
Unread Posts
Tags
  • 12 Forums
  • 2,530 Topics
  • 11 K Posts
  • 13 Online
  • 2,418 Members
Our newest member: Chad Treadwell
Latest Post: Negative/Credit Inventory Value?
Forum Icons: Forum contains no unread posts Forum contains unread posts
Topic Icons: Not Replied Replied Active Hot Sticky Unapproved Solved Private Closed

Online Members

 No online members at the moment

Acumatica Forums

Terms of Use & Disclaimers :: Privacy Policy

Copyright © 2026 · AUG Forums, LLC. All rights reserved. This website is not owned, affiliated with, or endorsed by Acumatica, Inc.

‹›×

    ‹›×