How to reference new field if it is DAC Extension

ぃ、小莉子 提交于 2020-01-15 09:20:11

问题


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.

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)

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.


回答1:


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

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

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

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



来源:https://stackoverflow.com/questions/39351055/how-to-reference-new-field-if-it-is-dac-extension

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!