Acumatica 在AR302000屏幕的PaymentRef字段中使用数字序列
我试图在AR302000支付和应用程序屏幕中使用此PHIEUTHU序列 自动填充ExtRefNbr文本字段 以下是我编写的代码:Acumatica 在AR302000屏幕的PaymentRef字段中使用数字序列,acumatica,Acumatica,我试图在AR302000支付和应用程序屏幕中使用此PHIEUTHU序列 自动填充ExtRefNbr文本字段 以下是我编写的代码: protected void ARPayment_RowPersisting(PXCache cache, PXRowPersistingEventArgs e) { base.ARPayment_RowPersisting(sender, e); //var row = (ARPayment)e.Row; if (this.IsImport)
protected void ARPayment_RowPersisting(PXCache cache, PXRowPersistingEventArgs e)
{
base.ARPayment_RowPersisting(sender, e);
//var row = (ARPayment)e.Row;
if (this.IsImport)
{
if ((e.Operation & PXDBOperation.Command) == PXDBOperation.Insert)
{
String numbering = ARSetup.Current.ExtRefNbr;
Boolean autonumber = true;
if (numbering != null)
{
Numbering num = PXSelect<Numbering, Where<Numbering.numberingID, Equal<Required<Numbering.numberingID>>>>.Select(this, numbering);
if (num != null && num.UserNumbering == true)
{
autonumber = false;
}
}}
}
var payment = (ARPayment)e.Row;
if (autonumber == false)
{
AutoNumberAttribute.SetNumberingId<APPayment.refNbr>(this.Document.Cache, payment.DocType, numbering);
}
protectedvoid ARPayment\u行持久化(PXCache缓存,PXRowPersistingEventArgs e)
{
基数。ARPayment_(发送方,e);;
//var行=(ARPayment)e行;
if(this.IsImport)
{
if((e.Operation&PXDBOperation.Command)=PXDBOperation.Insert)
{
字符串编号=ARSetup.Current.ExtRefNbr;
布尔自动编号=真;
如果(编号!=null)
{
编号num=PXSelect.Select(此,编号);
if(num!=null&&num.UserNumbering==true)
{
自动编号=假;
}
}}
}
var付款=(ARPayment)e.Row;
如果(自动编号==false)
{
AutoNumberAttribute.SetNumberringId
以下是错误:
\App_RuntimeCode\arpaymentry.cs(33):错误CS0117:
“PX.Data.pxGrapherExtension”没有
包含“ARPayment_RowPersisting”的定义
\App_RuntimeCode\arpaymentry.cs(33):错误CS0103:名称
“发件人”在当前上下文中不存在
\App_RuntimeCode\arpaymentry.cs(35):错误CS1061:
“PX.Objects.AR.ARPaymentEntry_扩展名”不包含定义
对于“IsImport”,并且没有扩展方法“IsImport”接受第一个
“PX.Objects.AR.ARPaymentEntry_扩展名”类型的参数可能为
找到(是否缺少using指令或程序集引用?)
\App_RuntimeCode\arpaymentry.cs(39):错误CS0117:
“PX.Objects.AR.ARSetup”不包含“当前”的定义
\App_RuntimeCode\arpaymentry.cs(43):错误CS0120:对象
非静态字段、方法或属性需要引用
'PX.Data.PXSelectBase.Select(参数
对象[])'\App\u RuntimeCode\arpaymentry.cs(54):错误CS0103:
当前上下文中不存在名称“自动编号”
\App_RuntimeCode\arpaymentry.cs(56):错误CS0246:类型或
找不到命名空间名称“APPayment”(是否缺少使用
指令或组件引用?)
\App_RuntimeCode\arpaymentry.cs(56):错误CS1061:
“PX.Objects.AR.ARPaymentEntry_扩展名”不包含定义
对于“文档”和无扩展方法“文档”接受第一个
“PX.Objects.AR.ARPaymentEntry_扩展名”类型的参数可能为
找到(是否缺少using指令或程序集引用?)
\App_RuntimeCode\arpaymentry.cs(56):错误CS0103:名称
“编号”在当前上下文中不存在
\App_RuntimeCode\arpaymentry.cs(33):错误CS0117:
“PX.Data.pxGrapherExtension”没有
包含“ARPayment_RowPersisting”的定义
我上传的包括图片,请看一看!
请一步一步帮我,我是新手。
感谢您的帮助!如果使用图形扩展,您将使用“Base”作为对基本图形的调用,而不是“Base”。在扩展事件时,您可以使用类似这样的行委托来调用基本调用。无论基本图形中是否存在基本调用,该示例都应该有效
public class ARPaymentEntry_Extension : PXGraphExtension<ARPaymentEntry>
{
protected virtual void ARPayment_RowPersisting(PXCache cache, PXRowPersistingEventArgs e, PXRowPersisting del)
{
// base call...
del?.Invoke(cache, e);
// extended logic...
}
}
公共类ARPaymentEntry_扩展名:pxGrapherExtension
{
受保护的虚拟void ARPayment_行持久化(PXCache缓存、PXRowPersistingEventArgs e、PXRowPersistingDel)
{
//基本呼叫。。。
del?.Invoke(缓存,e);
//扩展逻辑。。。
}
}
你是说代码会是这样的吗?布兰登先生:受保护的无效ARPayment_row持久化(PXCache缓存,PXRowPersistingEventArgs e,pxrowpersistingdel){base.ARPayment_row持久化(sender,e);//var row=(ARPayment)e.row;del?.Invoke(cache,e);if(this.IsImport){if((e.Operation&PXDBOperation.Command)=PXDBOperation.Insert)…我认为逻辑不是你的问题,而是扩展和基本图的使用。从我在评论中看到的情况来看,你所拥有的看起来不错,但你只需要将你的逻辑包含在我所拥有的//扩展逻辑中,就像你所拥有的一样。你仍然有问题/错误吗?不幸的是,我仍然有错误。它发生在行:“del?.Invoke(cache,e);”错误是:“CS1525:无效表达式项”“”、“CS1003:语法错误”“:“预期”并再次重复错误“CS1525:无效表达式项”“”。您可以使用较旧的.net版本。只需通过首先检查null,然后调用它来更改对委托的调用…如果(del!=null){del(缓存,e);}