我正在尝试在Acumatica中的Acumatica中添加一个在事务屏幕CA304000上的选项。以下是我想要达到的目标:
using System;
using System.Collections;
using System.Collections.Generic;
using PX.Data;
using PX.Objects.Common;
using PX.Objects.AP;
using PX.Objects.CM;
using PX.Objects.CS;
using PX.Objects.GL;
using PX.Objects.IN;
using PX.Objects.TX;
using PX.Objects.EP;
using PX.Objects.CR;
using Avalara.AvaTax.Adapter;
using Avalara.AvaTax.Adapter.TaxService;
using AvaAddress = Avalara.AvaTax.Adapter.AddressService;
using AvaMessage = Avalara.AvaTax.Adapter.Message;
using CRLocation = PX.Objects.CR.Standalone.Location;
using PX.Objects;
using PX.Objects.CA;
namespace PX.Objects.CA
{
public class CATranEntry_Extension:PXGraphExtension<CATranEntry>
{
#region Event Handlers
public override void Initialize()
{
Base.action.AddMenuAction(ShowURL);
}
public PXAction<CAAdj> ShowURL;
[PXUIField(DisplayName = "Phieu Thu")]
[PXButton]
protected virtual void showURL()
{
CAAdj doc = Base.Document.Current;
if (doc.RefNbr != null)
{
throw new PXReportRequiredException(doc, "TNCA6401", null);
}
}
#endregion
}
}然而,这告诉我有('PX.Objects.CA.CATranEntry‘不包含'Document’的定义,并且不能找到接受'PX.Objects.CA.CATranEntry‘类型的第一个参数的扩展方法'Document’)两次。
此TNCA6401只有一个参数中心引用号。请具体说明(图像是最好的)。我是努布。谢谢你。
发布于 2017-05-27 23:57:50
您应该使用CAAdjRecords数据视图,而不是Document。CAAdj doc = Base.Document.Current;应该是CAAdj doc = Base.CAAdjRecords.Current
Reference Nbr.和AdjRefNbr字段绑定在一起。
您可以使用Customization -> Inspect Element来识别屏幕正在与哪个Graph、Data View、DAC和DAC field一起工作。

https://stackoverflow.com/questions/44213060
复制相似问题