本文介绍了Acumatica 将自定义字段引用到不同屏幕上的另一个自定义字段的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在客户屏幕中创建了 2 个自定义字段(UsrFFA 和 UsrFreeFreightDay),如下所示.客户屏幕

I have created 2 custom fields(UsrFFA and UsrFreeFreightDay) as below in the Customers Screen.Customers Screen

然后我在销售订单屏幕上创建了类似的字段,如下所示销售订单

Then I created similar fields on the Sales Order Screen as belowSales Order

我希望销售订单屏幕上的这些字段填充相应客户 ID 的值.

I want these fields on Sales Order screen to populate values for respective Customer ID.

我翻阅了T200的培训资料,找到了这个代码

I went through the training material T200 and found this code

 protected void SOOrder_CustomerID_FieldUpdated(PXCache sender,PXFieldUpdatedEventArgs e)
{
 SOOrder order = e.Row as SOOrder;
 BAccount customer =
 PXSelectorAttribute.Select<SOOrder.customerID>(sender, order)
 as BAccount;
 if (customer != null)
 {
 Contact defContact = PXSelect<Contact,
 Where<Contact.bAccountID, Equal<Required<Contact.bAccountID>>,
 And<Contact.contactID, Equal<Required<Contact.contactID>>>>>
 .Select(Base, customer.BAccountID, customer.DefContactID);
 if (defContact != null)
 {
 ContactExt contactExt = PXCache<Contact>
 .GetExtension<ContactExt>(defContact);
 sender.SetValue<SOOrderExt.usrCRVerified>(order,
 contactExt.UsrCreditRecordVerified);
 }
 }
}

我无法理解此代码以及如何在自定义中使用它.

I am not able to understand this code and how should I use it in my customization.

推荐答案

自定义 SOOrder 字段的属性如下:

Customize the attributes on the SOOrder field in the following way:

对于 UsrFFA 字段

[PXDBString(100)]
[PXUIField(DisplayName="FFA", Visible = true, Enabled = false)]
[PXFormula(typeof(Selector<SOOrder.customerID, BAccountExt.usrFFA>))]

对于 UsrFreeFreightDay 字段

[PXDBString(100)]
[PXUIField(DisplayName="Free Freight Day", Visible = true, Enabled = false)]
[PXFormula(typeof(Selector<SOOrder.customerID, BAccountExt.usrFreeFreightDay>))]

这篇关于Acumatica 将自定义字段引用到不同屏幕上的另一个自定义字段的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-04 22:28