Skip to main content

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

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>


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?


@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.


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?

gPXFilterable]
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