Solved

Drop Down Field Values in Reports

  • 17 March 2022
  • 1 reply
  • 76 views

Userlevel 5
Badge

I have a user defined drop down field. I want to show the display values, not the stored variable values. When I run a GI, I get the values that my users see. When I run a report, I get the underlying variables.

Here is my setup:

[PXDBString(20)]
[PXUIField(DisplayName="Routed")]
[PXStringList(
new string[] { "", "NA", "TD", "SR", "92", "LA", "TPS", "TPL", "TPN", "TGP", "TGS", "BD"}, 
new string[] { "", "N/A", "Troutdale", "92nd BLDG 3", "92nd BLDG 4",  "LA 3PL", "TP Seattle", "TP LA/LB", "TP New York", "TGR PDX", "TGR SeaTac", "Boyd 3PL"})]

 

When I call the field UsrRouted in a GI I get the bottom string as expected (Like “Troutdale). When I call the field in the report writer, I get the field codes from the first string (Like “TD”). How do I get the display codes from the 2nd string in a report? I can make an abomination of an “IF” statement, but that’s not the right answer, because it can’t be scaled.

 

Thanks Everyone!

icon

Best answer by mcraig95 17 April 2023, 19:02

View original

1 reply

Userlevel 3
Badge +1

You could try the Switch construct? Which is like a case or goto.  It can grow and is much more readable for a complex statement.  Matt

 

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