Multi-Company Drop-Down

Hi All,

Today want to show you how to have different values of drop-down in different companies:

  • Company One
    • Values 1, 2, 3
    • Labels “1”, “2”, “3”
  • Company Two
    • Values 3, 4, 5
    • Labels “1”, “2”, “3”

To do this we can use following nice features in Acumatica Platform:

  1. PX.Data.Update.PXInstanceHelper.CurrentCompany – to get ID of current company
  2. FieldSelecting – Event where you can change/adjust value just before it will be included in response to browser.
  3. e.ReturnState = PXStringState.CreateInstance(…) – State contains full description of control that should be generated in the user interface with app UI properties and configurations. By adjusting state on the fly you can change list of allowed labels and values
  4. Custom Attributes – to reuse one logic in many places

Please see full code example under the cut.

Code Example:

Have a nice development.

Leave a Reply

Your email address will not be published. Required fields are marked *