Skip to main content
Solved

DynamicSelector based on dropdown value

  • February 11, 2022
  • 7 replies
  • 697 views
  • Translate All

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
View original

7 replies

Naveen Boga
Captain II
Forum|alt.badge.img+20

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

 

 

Translate

Forum|alt.badge.img+1

Hi @Naveen B ,

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

 

 

 

Thanks,

Moulali Shaik.

Translate

Naveen Boga
Captain II
Forum|alt.badge.img+20

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.

Translate

Forum|alt.badge.img+1

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.

 

 

Translate

jinin
Pro I
Forum|alt.badge.img+12
  • 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
Translate

Forum|alt.badge.img+1

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.

 

 

Translate

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

Thank you @MoulaliShaik79  for the update

Translate