Skip to main content
Answer

DynamicSelector based on dropdown value

  • February 11, 2022
  • 7 replies
  • 627 views

Forum|alt.badge.img+1

Hi All,

I have a form with two fields: 

1- dropdown field with values like Opportunity & Service Orders.

2- Selector field to show Opportunity or Service Orders Base selector values based on the dropdown value.

How can I reuse the existing selectors of base class?.

 

 

Thanks in Advance,

Moulali Shaik.

 

 

 

Best answer by jinin

  

Hi @MoulaliShaik79 

  •      You can create 2 separate selector fields for Opportunity and ServiceOrders.
  •      Based on the Dropdown selection, you can enable the fields, If selected as ServiceOrders, show Service Orders selector. If Opportunity selected, show Opportunity selector. Manage this on the row selected event.

    Not sure we can add a condition based selector for the DAC field

7 replies

Naveen Boga
Captain II
Forum|alt.badge.img+19
  • Captain II
  • February 11, 2022

Hi, @MoulaliShaik79  Is this your custom form?

If you wanted to use as same selectors, you can take it from the respective DACs.

  • Opportunity.cs
  • FSServiceOrders.cs

 

 


Forum|alt.badge.img+1
  • Author
  • Semi-Pro II
  • February 11, 2022

Hi @Naveen B ,

I need to show them in the dynamic selector based on the dropdown value.

 

 

 

Thanks,

Moulali Shaik.


Naveen Boga
Captain II
Forum|alt.badge.img+19
  • Captain II
  • February 11, 2022

Yes @MoulaliShaik79  You can add a condition for that selector you in DAC to pass the Dropdown value. 

So that based on your dropdown value, Selector field will load the values accordingly.


Forum|alt.badge.img+1
  • Author
  • Semi-Pro II
  • February 11, 2022

Hi @Naveen B,

I have tried the below approach with Id and Description field. it is working fine,

LINK:

====

https://stackoverflow.com/questions/37053983/dynamically-changing-pxselector-in-acumatica

 

But to get all the fields (approximately 30 fields from the base selectors), I need to declare 30 fields and need to pass 30 fields in the attribute constructor. Instead of the declaring 30 fields, I am looking another approach.

 

Currently approach:

===============

As you suggested taking them from the respective DAC, Do I need to create 2 unbound properties for the 2 selectors (Opportunity & Service Orders)? or Can we have 2 Selector attributes under the single DAC field (here my DAC field is : RefNbr which is string type).

or How can I write the condition inside the DAC? any basic syntax example… would be helpful to me.

 

 

Thanks

Moulali Shaik.

 

 


jinin
Pro I
Forum|alt.badge.img+11
  • Pro I
  • Answer
  • February 11, 2022

  

Hi @MoulaliShaik79 

  •      You can create 2 separate selector fields for Opportunity and ServiceOrders.
  •      Based on the Dropdown selection, you can enable the fields, If selected as ServiceOrders, show Service Orders selector. If Opportunity selected, show Opportunity selector. Manage this on the row selected event.

    Not sure we can add a condition based selector for the DAC field

Forum|alt.badge.img+1
  • Author
  • Semi-Pro II
  • February 14, 2022

Hi @jinin ,  @Naveen B,

As you suggested, I took 2 separate selectors and  done visible and invisible functionality in the RowSelected Event Handler to make it as work as excepted based on the dropdown values. Now It is working fine.

Thanks a lot for your help.

 

 

Thanks,

Moulali Shaik.

 

 


jinin
Pro I
Forum|alt.badge.img+11
  • Pro I
  • February 14, 2022

Thank you @MoulaliShaik79  for the update