Acumatica 需要调整动作的工作方式

Acumatica 需要调整动作的工作方式,acumatica,Acumatica,我必须调整动作的工作方式。我知道我无法调整运行操作本身的代码,所以在执行特定操作时,有没有办法执行额外的代码?您只需在扩展中声明与“覆盖”基本操作相同的操作即可 以下是覆盖总账日记账分录上的查看源文档操作的示例: public class JournalEntryMyExtension : PXGraphExtension<JournalEntry> { public PXAction<Batch> viewDocument; [PXLookupButto

我必须调整动作的工作方式。我知道我无法调整运行操作本身的代码,所以在执行特定操作时,有没有办法执行额外的代码?

您只需在扩展中声明与“覆盖”基本操作相同的操作即可

以下是覆盖总账日记账分录上的查看源文档操作的示例:

public class JournalEntryMyExtension : PXGraphExtension<JournalEntry>
{
    public PXAction<Batch> viewDocument;
    [PXLookupButton]
    [PXUIField(DisplayName = "View Source Document", MapEnableRights = PXCacheRights.Select, MapViewRights = PXCacheRights.Select)]
    public virtual IEnumerable ViewDocument(PXAdapter adapter)
    {
        // Logic Before Base Action

        Base.viewDocument.Press(adapter);

        // Logic After Base Action

        return adapter.Get();
    }
}
公共类JournalEntryExtension:pxGrapherExtension
{
公共行动文件;
[查看按钮]
[PXUIField(DisplayName=“查看源文档”,MapEnableRights=PXCacheRights.Select,MapViewRights=PXCacheRights.Select)]
公共虚拟IEnumerable ViewDocument(PXAdapter)
{
//基本行动前的逻辑
Base.viewDocument.Press(适配器);
//基本动作后的逻辑
返回适配器Get();
}
}
以下是用于比较的基本图中的直接操作:

public PXAction<Batch> viewDocument;
[PXUIField(DisplayName = Messages.ViewSourceDocument, MapEnableRights = PXCacheRights.Select, MapViewRights = PXCacheRights.Select)]
[PXLookupButton()]
public virtual IEnumerable ViewDocument(PXAdapter adapter)
{
    if (this.GLTranModuleBatNbr.Current != null)
    {
        GLTran tran = (GLTran) this.GLTranModuleBatNbr.Current;

        OpenDocumentByTran(tran, BatchModule.Current);
    }

    return adapter.Get();
}
public-PXAction-viewDocument;
[PXUIField(DisplayName=Messages.ViewSourceDocument,MapEnableRights=PXCacheRights.Select,MapViewRights=PXCacheRights.Select)]
[PXLookupButton()]
公共虚拟IEnumerable ViewDocument(PXAdapter)
{
if(this.gltransmodulebatnbr.Current!=null)
{
GLTran tran=(GLTran)this.GLTranModuleBatNbr.Current;
OpenDocumentByTran(tran,BatchModule.Current);
}
返回适配器Get();
}

好的,我试试看。非常感谢Brendan!布伦丹,我可能把这个问题说得太笼统了。你的答案看起来是正确的,但我当然在尝试调整一些不正常的行为。我正在调整CreateShipping在SOOrderEntry中的工作方式,但似乎该操作有自己的BLC:SoCreateShipping。我要调查一下。如果您在过去处理过调整此特定操作,则欢迎您提供建议。在这种情况下,您可以在SOShipmentEntry上进行图形扩展,在CreateShipping上进行PXOverride。在调用基本委托之前或之后运行代码。希望这能帮上忙,我相信这就是我需要做的。我找错地方了。正如你所提到的,我应该在SOShipmentEntry中查找。非常感谢Brendan!如果我想覆盖SOOrder中的PXButton操作,我是否需要设置任何不同的操作,因为该按钮有更多的变量,按钮函数中有多个操作定义,一个通过函数填充并返回的列表?