I have the following use case:
Acumatica combo box / dropdown, which can have 8 or so values, the selection of which determines the table / DAC used to present in a PXSelector.
e.g.:
-If user select option a, I need to show in PXSelector values from Table A
-If user select option b, I need to show in PXSelector values from Table B
-If user select option c, I need to show in PXSelector value from Table C
I understand that I'd have to use a Custom Selector Attribute, but the details of how to do this are not clear.
As you said, you need to implement an attribute that inherits from the
PXCustomSelectorAttribute
class.1- Create a class
PromptType
that will have anID
andDescription
that will hold the types of each table.2- Implement the customSelectorAttribute, like this:
You can change the constructor of the custom attribute, by passing the desired number of tables.
3- Once you have implemented your custom attribute, you can use it in your field like this:
4- Also, you should not forget to set the visibility on your tables fields. I'm referring to the tables (
DACs
) that you want to display in the selector. Let say that you want to displayTableA
,TableB
orTableC
depending on your drop down, you need to set the visibility on the fields that you are going to use in the selector.Here's the implementation of one of the tables that I used during my tests:
By setting the visibility to
SelectorVisible
, the field will be displayed automatically in the PXSelector.5- Finally, you need to set
CommitChanges
toTrue
on your dropdown and setAutoRefresh
toTrue
on your form field. Here's an example: