如果是DAC扩展,如何引用新字段 [英] How to reference new field if it is DAC Extension

查看:58
本文介绍了如果是DAC扩展,如何引用新字段的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在销售订单中有几个新字段(屏幕ID-SM204505)。我从定制项目>数据访问中添加了这些字段。发布此自定义项目后,所有新字段都将在SOOrder表中创建。

I have a couple of new fields in Sales Order (Screen ID - SM204505). I have added these fields from customization project > Data Access. Once published this customization project all the new fields are created in SOOrder table.

现在,我想在Visual Studio的自定义项目中引用这些新字段以填充其他一些值(即添加更多业务逻辑)。
例如,在SOOrder表中添加了一个名为UsrReasonCode的自定义字段。然后,我想编写一些业务逻辑以从SOOrder中获取此值并填充到其他表中(即,Document Line项目> ReasonCode)

Now I want to reference these new fields in my Customization Project in Visual Studio to fill some other values (i.e. add some more business logic). For example, there is a custom field called UsrReasonCode added to SOOrder table. And then I want to write some business logic to get this value from SOOrder and fill into some other table (i.e. Document Line item > ReasonCode)

如果我创建表扩展名,但是我不确定如何通过DAC扩展名添加它。

It is working if I create Table Extension but I am not sure how to reference if I add it through DAC Extension. Please suggest.

推荐答案

您可以使用扩展对象
来引用扩展字段,如下所示:

You can reference extension fields by using extension object like that:

DocExt ext=PXCache<Doc>.GetExtension<DocExt>(doc);

这将获得与以下内容相关的扩展对象 DocExt 原始Doc对象。因此,您可以引用扩展字段,例如 ext.UsrField

This will get extension object DocExt related to the original Doc object. So you can reference extension fields like ext.UsrField.

要了解更多信息,可以从以下位置下载T300培训昆士兰大学

To read more about that you can download T300 training from acumatica university

这篇关于如果是DAC扩展,如何引用新字段的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆