Solved

Use of SWITCH in Generic Inquiry

  • 29 April 2024
  • 5 replies
  • 38 views

Userlevel 4
Badge

I am using SWITCH in a Generic Inquiry but the column comes up without any values. 

My formula is as follows: =SWITCH(([SOInvoice.DocType] = 'Credit Memo'), 'C',([SOInvoice.DocType] = 'Invoice'), 'O')

So what I am attempting to do is if the DocType = ‘Credit Memo’, change the field to a ‘C’ and if it is an ‘Invoice’ change to an ‘O’.

icon

Best answer by travislawson 29 April 2024, 15:01

View original

5 replies

Userlevel 4
Badge

I found my own solution: =SWITCH(([SOInvoice.DocType] = 'Credit Memo'), 'C', ‘O’). Anyone has a better way?.

Userlevel 3
Badge

SOInvoice.DocType is a char(3) which means 3 characters.

 

Credit Memo is CRM, Invoice is INV.  So you’re original switch is correct, just not implemented correctly:


I split it up into separate lines so you can see it better. 

=SWITCH(

[SOInvoice.DocType] = 'CRM', 'C',

[SOInvoice.DocType] = 'INV', 'O'

)

 

Userlevel 4
Badge

Thank you for the additional feedback.

Userlevel 3
Badge

Thank you for the additional feedback.

Also to help you further to find out these codes, in at least 2023R1, open your invoices screen and you can go to Customization → Inspect Element (or CTRL+ALT and click) and click on the Type field.  It’ll have a drop-down values button. 

 

 

 

 

 

Userlevel 4
Badge

Thank you for that screenshot.

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