You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Generic Inquiry扩展问询:能否添加自定义Action或创建自定义展示屏幕

Absolutely! Both of your requests are totally achievable in Acumatica—let’s break this down step by step.

Adding Custom Actions to a Generic Inquiry Results Page

You absolutely can add custom actions to a Generic Inquiry (GI) results page, and it’s a common customization. Here’s how to do it:

  1. Enable Customization for the GI
    First, open your GI in the design screen, go to the Settings tab, and make sure the Allow Customization checkbox is checked. This lets you extend the GI’s underlying graph.

  2. Add the Custom Action in the GI Designer
    Navigate to the Actions tab of the GI. Click Add Action, give it a display name, set its location (e.g., Toolbar to show it above the results grid), and save the GI.

  3. Implement the Action Logic with a Graph Extension
    Create a graph extension for the GI’s base graph (GenericInqGraph) to define the action’s behavior. Here’s a simple example that processes the GI’s results:

    public class MyGI_GraphExtension : PXGraphExtension<GenericInqGraph>
    {
        // Define the custom action
        public PXAction<GenericInqGraph> ProcessSelectedRows;
        [PXButton(CommitChanges = true)]
        [PXUIField(DisplayName = "Process Selected Rows")]
        protected void processSelectedRows()
        {
            // Get the selected rows from the GI results view
            var selectedRows = Base.Views["Results"].SelectMultiBound();
            
            foreach (var row in selectedRows)
            {
                // Access field values from the row (adjust field names to match your GI)
                var customerID = row.GetItem<int?>(typeof(Customer.BAccountID).Name);
                var orderDate = row.GetItem<DateTime?>(typeof(SOOrder.OrderDate).Name);
                
                // Execute your custom logic here: update records, send emails, generate documents, etc.
            }
        }
    }
    

    Deploy this extension, and your custom action will appear on the GI results page, ready to run against the query’s data.

Creating a Custom Page to Display GI Data

If you’d prefer not to extend the default GI page, building a custom page to display the GI’s data is just as straightforward:

  1. Create a Custom Graph
    Build a new graph that either replicates the GI’s query or loads the existing GI definition directly. This gives you full control over data access:

    public class CustomGIDisplayGraph : PXGraph<CustomGIDisplayGraph>
    {
        // Load data using your GI's ID (replace "SalesOrdersGI" with your GI's unique ID)
        public PXSelectFrom<GenericInqResult>.View GIResults;
    
        public CustomGIDisplayGraph()
        {
            // Fetch the GI's query definition
            var giQuery = PXGenericInqGrph.GetGIQuery("SalesOrdersGI");
            // Apply the GI's query to your view
            GIResults.View.BqlSelect = giQuery.BqlSelect;
        }
    }
    
  2. Build the Custom ASPX Page
    Create a new ASPX page in Acumatica’s customization editor, add a PXGrid control, and bind it to the GIResults view from your custom graph. You can fully customize the grid’s columns, filters, layout, and add additional actions specific to this page—something you can’t always do with a standard GI.

  3. Configure Permissions
    Don’t forget to set up security permissions for your custom page and graph, so the right users can access it.

A few quick notes:

  • For the GI action approach, you can target either all results or just selected rows (using SelectMultiBound() as shown).
  • With a custom page, you can integrate other Acumatica components (like dashboards, related records, or custom UI elements) seamlessly.

内容的提问来源于stack exchange,提问作者Joseph Caruana

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.15 04:18:19