Skip to main content
Answer

Search multi-column in PXSelector

  • April 6, 2023
  • 7 replies
  • 353 views

Forum|alt.badge.img

Hi expert. Have a nice day.

I custom PXSelector field in below image. I want search on both columns(Description and Asset ID).

I try code:

 [PXSelector(typeof(Search<FixedAsset.assetCD>),typeof(Search<FixedAsset.description>))]

but system build error:

Can you help me this case? Thank you so much.

Best answer by Naveen Boga

@thanhaim  Can you try like below and check 

 

        [PXSelector(typeof(Search<FixedAsset.assetCD>), typeof(FixedAsset.assetCD), typeof(FixedAsset.description), DescriptionField = typeof(FixedAsset.description), Filterable = true)]

 

7 replies

Naveen Boga
Captain II
Forum|alt.badge.img+19
  • Captain II
  • April 6, 2023

@thanhaim  Can you please try with below code but I think it will work with search with multiple columns.

 


 [PXSelector(typeof(Search<FixedAsset.assetCD>),typeof(FixedAsset.assetCD), typeof(FixedAsset.description))]


Forum|alt.badge.img
  • Author
  • Freshman II
  • April 6, 2023

@Naveen Boga Thank you for your reply. In this morning. I tried your solution

 [PXSelector(typeof(Search<FixedAsset.assetCD>),typeof(FixedAsset.assetCD), typeof(FixedAsset.description))]

But.

we have more anyone ideal? Thank you so much.


Naveen Boga
Captain II
Forum|alt.badge.img+19
  • Captain II
  • Answer
  • April 6, 2023

@thanhaim  Can you try like below and check 

 

        [PXSelector(typeof(Search<FixedAsset.assetCD>), typeof(FixedAsset.assetCD), typeof(FixedAsset.description), DescriptionField = typeof(FixedAsset.description), Filterable = true)]

 


Forum|alt.badge.img+9
  • Semi-Pro III
  • April 6, 2023

Hi @thanhaim ,

  • Could you please try to set the FilterByAllFields value set to true in Layout Properties section of that particular custom field.

 

or else,

  • You can try to add AutoSearchFields Property to the selector.
AutoSearchFields = typeof(InventoryItem.inventoryCD, InventoryItem.descr))]
  • You can also try to add Filterable= true to the selector.

Hope, It helps!

Regards,

Sweta


Forum|alt.badge.img
  • Author
  • Freshman II
  • April 6, 2023

I’m happy and I relly thank @Naveen Boga @sweta68  for your solution. I tried both. its good. 


Naveen Boga
Captain II
Forum|alt.badge.img+19
  • Captain II
  • April 6, 2023

Great :) Thanks for sharing the update!! @thanhaim 


Forum|alt.badge.img
  • Author
  • Freshman II
  • April 14, 2023

hi @Naveen Boga @sweta68 

Now I want search multi field in this txtbox (as in the picture). I try 3 solution above, but not ok. Can you help me? Thank you so much