【问题标题】:Render Action button渲染动作按钮
【发布时间】:2017-12-01 16:05:12
【问题描述】:

我正在使用 FormDetail 模板创建一个新屏幕,其中我将有一个过滤器 DAC 和 DAC 列表以显示在网格上。我成功创建了页面。然后,我想在按钮顶部放置一个按钮,该按钮将从 api 中提取数据并刷新网格。所以,我编写了下面的代码来在页面(FormDetail)上呈现一个操作按钮,就像这样。 但是,它不起作用。

    using System;
using PX.Data;

namespace AcumaticaSquarePOSIntegration
{
  public class SquarePOSTransactionInquiry : PXGraph<SquarePOSTransactionInquiry>
  {

    public PXSave<MasterTable> Save;
    public PXCancel<MasterTable> Cancel;


    public PXFilter<MasterTable> MasterView;
    public PXFilter<DetailsTable> DetailsView;

    public PXAction<MasterTable> Calc;

    [PXUIField(DisplayName="Calc")]
    [PXButton]
    protected virtual IEnumerable calc(PXAdapter adapter)
    {
      return adapter.Get();
    }


    [Serializable]
    public class MasterTable : IBqlTable
    {

    }

    [Serializable]
    public class DetailsTable : IBqlTable
    {

    }


  }

      }

我什至尝试添加

这里有什么我遗漏的吗?

【问题讨论】:

    标签: acumatica


    【解决方案1】:

    您有两个 PXFilter,将第二个更改为 PxSelect 并将 PXFilter 设为列表中的第一个数据视图。

    【讨论】:

    • 我忘了更改那部分。但是,即使将 DetailsView 更改为 PXSelect 也不能​​解决问题。
    【解决方案2】:

    尝试使用 PXProcessButton 而不是 PXButton。 还要确保在 aspx 中将 MasterView 指定为 PrimaryView。

    【讨论】:

    • 还是没有运气。这是更改后的代码。 public PXAction&lt;DetailsTable&gt; calc; [PXUIField(DisplayName="Calc")] [PXProcessButton] protected virtual void Calc(PXAdapter adapter) { } 主要视图是 MasterView。 screencast.com/t/bMLf5f4H
    • 由于主视图是 MasterView - 您应该指定 PXAction(不是现在的 PXAction)。
    • 糟糕。愚蠢的错误。谢谢你。 :)
    猜你喜欢
    • 2014-10-18
    • 1970-01-01
    • 2021-03-22
    • 2011-11-02
    • 2016-02-28
    • 2018-02-25
    • 2011-04-30
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多