Solved

How to create a Multiple Selector

  • 2 February 2023
  • 4 replies
  • 267 views

Userlevel 3
Badge

Hello expers,

I don’t know if it is possible to create a Multiple Selector?

In case it is impossible. Is there any workaround to achieve this goal?

I found an article https://asiablog.acumatica.com/2018/01/multi-select-selector.html but it doesn’t work.

Thank you for your sharing.

 

Regards,

Khoi

icon

Best answer by Naveen Boga 2 February 2023, 15:17

View original

4 replies

Userlevel 7
Badge +17

Hi, @mrthanhkhoi  Multi-Select Selector is possible.

Can you please share your code here?

 

Have you added this in the .aspx page? 

 

<px:PXMultiSelector runat="server" DataField="Ledger" ID="CstPXSelector4" CommitChanges="True" ></px:PXMultiSelector>

Userlevel 3
Badge

Hi @Naveen Boga,

thank you for your answer. It works for me.

By the way, I create a multiple selector in order to filter list ReplenishmentItem by this selector instead of Warehouse (single selector)

Which part should I modify to change filter by new multiple selector?

Userlevel 7
Badge +17

@mrthanhkhoi 

I’m glad that I helped you on getting the Multi-Select selector field.

 

You need to check the view delegate and modify the logic accordingly to fetch the selected multiple warehouses’ details and populate in the grid.

Userlevel 3
Badge

Hi @Naveen Boga 

I have modified the view as following code but it doesn’t work. I guess there is an issue with condition Where<INReplenishmentItem.siteID, In<Current<INReplenishmentFilterExt.usrWarehouse»

I tried with Where<Current<INReplenishmentFilterExt.usrWarehouse>, Contains<INReplenishmentItem.siteID> but it does not work too :(

Could you please have a look and and instruct me?

[PXFilterable]
public Processing<INReplenishmentItem> Records;
//If update Acmatica to later version need to check this function to update it to latest code from Acumatica (keep use INReplenishmentItem.siteID in INReplenishmentFilterExt.usrWarehouse
public class Processing<Type> :
PXFilteredProcessingJoin<INReplenishmentItem, INReplenishmentFilter,
LeftJoin<INItemClass, On<INReplenishmentItem.FK.ItemClass>>,
Where<INReplenishmentItem.siteID, In<Current<INReplenishmentFilterExt.usrWarehouse>>,//The original is: Where<INReplenishmentItem.siteID, Equal<Current<INReplenishmentFilter.replenishmentSiteID>>
And2<Where<
Current<INReplenishmentFilter.itemClassCDWildcard>, IsNull,
Or<INItemClass.itemClassCD, Like<Current<INReplenishmentFilter.itemClassCDWildcard>>>>,
And2<Where<
INReplenishmentItem.launchDate, IsNull,
Or<INReplenishmentItem.launchDate, LessEqual<Current<INReplenishmentFilter.purchaseDate>>>>,
And<Where<
INReplenishmentItem.terminationDate, IsNull,
Or<INReplenishmentItem.terminationDate, GreaterEqual<Current<INReplenishmentFilter.purchaseDate>>>>>
>>>>
where Type : INReplenishmentItem
{

public Processing(PXGraph graph)
: base(graph)
{
this._OuterView = new PXView(graph, false, BqlCommand.CreateInstance(
typeof(
Select2<INReplenishmentItem,
LeftJoin<INItemClass, On<INReplenishmentItem.FK.ItemClass>>,
Where<INReplenishmentItem.siteID, In<Current<INReplenishmentFilterExt.usrWarehouse>>,//The original is: Where<INReplenishmentItem.siteID, Equal<Current<INReplenishmentFilter.replenishmentSiteID>>
And2<Where<
Current<INReplenishmentFilter.itemClassCDWildcard>, IsNull,
Or<INItemClass.itemClassCD, Like<Current<INReplenishmentFilter.itemClassCDWildcard>>>>,
And2<Where<
INReplenishmentItem.launchDate, IsNull,
Or<INReplenishmentItem.launchDate, LessEqual<Current<INReplenishmentFilter.purchaseDate>>>>,
And<Where<
INReplenishmentItem.terminationDate, IsNull,
Or<INReplenishmentItem.terminationDate, GreaterEqual<Current<INReplenishmentFilter.purchaseDate>>>>>
>>>>)));

this._OuterView.WhereAndCurrent<INReplenishmentFilter>(nameof(INReplenishmentFilter.itemClassCDWildcard), nameof(INReplenishmentFilter.itemClassCD));
this._OuterView.WhereAnd<Where<Current<INReplenishmentFilter.onlySuggested>, Equal<False>, Or<INReplenishmentItem.qtyProcessInt, Greater<decimal0>>>>();
}
}

Here is the definition of UsrWarehouse field

public class INReplenishmentFilterExt : PXCacheExtension<PX.Objects.IN.INReplenishmentFilter>
{
#region UsrWarehouse
[PXSelector(typeof(INSite.siteCD), typeof(INSite.siteCD), typeof(INSite.descr), ValidateValue = false)]
[PXUIField(DisplayName = "Warehouse")]

public virtual string UsrWarehouse { get; set; }
public abstract class usrWarehouse : PX.Data.BQL.BqlString.Field<usrWarehouse> { }
#endregion
}

 

Reply


About Acumatica ERP system
Acumatica Cloud ERP provides the best business management solution for transforming your company to thrive in the new digital economy. Built on a future-proof platform with open architecture for rapid integrations, scalability, and ease of use, Acumatica delivers unparalleled value to small and midmarket organizations. Connected Business. Delivered.
© 2008 — 2024  Acumatica, Inc. All rights reserved