Skip to main content
Solved

How to do this ,On Selector of Inventory ID list button,It should fiter data according to Inventory Id (Multiselector ) that filtered data should be visible on grid.

  • September 19, 2023
  • 2 replies
  • 110 views

Example one base screen is available in acumatica screenID: SO503050 & graph name: SOPickingWorksheetProcess for List button

Best answer by sweta68

Hi @mayurig23 ,

Kindly find below code snippet. I have not implemented it at my end but I believe it works for you.

#region Views
[PXVirtualDAC]
		[PXImport(typeof(HeaderFilter))]
		public PXSelect<InventoryLinkFilter> SelectedItems;
		public IEnumerable selectedItems() => SelectedItems.Cache.Cached.Cast<InventoryLinkFilter>().Where(t => SelectedItems.Cache.GetStatus(t) != PXEntryStatus.Deleted).ToArray();

#endregion

#region Actions
	[PXButton, PXUIField(DisplayName = "List")]
		public virtual void selectItems() => SelectedItems.AskExt();
		public PXAction<HeaderFilter> SelectItems;
#Endregion

and call this action in aspx as well to the button as below.


 <CallbackCommands>			
            <px:PXDSCallbackCommand Visible="false" Name="SelectItems" CommitChanges="true" />
        </CallbackCommands>

<px:PXButton runat="server" ID="btnItemList" Text="List" CommandName="SelectItems" CommandSourceID="ds"></px:PXButton>



    <%-- Inventory Item List Dialog --%>
    <px:PXSmartPanel ID="InventoryItemListDialog" runat="server" Caption="Inventory Item List" CaptionVisible="True" Key="selectedItems" LoadOnDemand="True" AutoRepaint="True">
        <px:PXGrid ID="gridItemList" runat="server" DataSourceID="ds" SkinID="Details" SyncPosition="True">
            <Levels>
                <px:PXGridLevel DataMember="selectedItems">
                    <Columns>
                        <px:PXGridColumn DataField="InventoryID" />
                        <px:PXGridColumn DataField="Descr" />
                    </Columns>
                    <RowTemplate>
                        <px:PXSegmentMask ID="iidInventoryID" runat="server" DataField="InventoryID" CommitChanges="True" />
                    </RowTemplate>
                    <Layout ColumnsMenu="False" />
                </px:PXGridLevel>
            </Levels>
            <AutoSize Enabled="True" MinHeight="300" />
            <Mode AllowAddNew="True" AllowDelete="True" AllowUpdate="True" AllowUpload="True" AllowFormEdit="False" />
        </px:PXGrid>
    </px:PXSmartPanel>

Hope, it helps!

Regards,

Sweta

View original
Did this topic help you find an answer to your question?

2 replies

  • Author
  • Freshman I
  • 2 replies
  • September 19, 2023

 


Forum|alt.badge.img+9
  • Semi-Pro III
  • 229 replies
  • Answer
  • September 20, 2023

Hi @mayurig23 ,

Kindly find below code snippet. I have not implemented it at my end but I believe it works for you.

#region Views
[PXVirtualDAC]
		[PXImport(typeof(HeaderFilter))]
		public PXSelect<InventoryLinkFilter> SelectedItems;
		public IEnumerable selectedItems() => SelectedItems.Cache.Cached.Cast<InventoryLinkFilter>().Where(t => SelectedItems.Cache.GetStatus(t) != PXEntryStatus.Deleted).ToArray();

#endregion

#region Actions
	[PXButton, PXUIField(DisplayName = "List")]
		public virtual void selectItems() => SelectedItems.AskExt();
		public PXAction<HeaderFilter> SelectItems;
#Endregion

and call this action in aspx as well to the button as below.


 <CallbackCommands>			
            <px:PXDSCallbackCommand Visible="false" Name="SelectItems" CommitChanges="true" />
        </CallbackCommands>

<px:PXButton runat="server" ID="btnItemList" Text="List" CommandName="SelectItems" CommandSourceID="ds"></px:PXButton>



    <%-- Inventory Item List Dialog --%>
    <px:PXSmartPanel ID="InventoryItemListDialog" runat="server" Caption="Inventory Item List" CaptionVisible="True" Key="selectedItems" LoadOnDemand="True" AutoRepaint="True">
        <px:PXGrid ID="gridItemList" runat="server" DataSourceID="ds" SkinID="Details" SyncPosition="True">
            <Levels>
                <px:PXGridLevel DataMember="selectedItems">
                    <Columns>
                        <px:PXGridColumn DataField="InventoryID" />
                        <px:PXGridColumn DataField="Descr" />
                    </Columns>
                    <RowTemplate>
                        <px:PXSegmentMask ID="iidInventoryID" runat="server" DataField="InventoryID" CommitChanges="True" />
                    </RowTemplate>
                    <Layout ColumnsMenu="False" />
                </px:PXGridLevel>
            </Levels>
            <AutoSize Enabled="True" MinHeight="300" />
            <Mode AllowAddNew="True" AllowDelete="True" AllowUpdate="True" AllowUpload="True" AllowFormEdit="False" />
        </px:PXGrid>
    </px:PXSmartPanel>

Hope, it helps!

Regards,

Sweta


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings