问题描述
我在我的定制项目中对CROpportunity进行了DAC扩展,该扩展在6.10和2017R2中运行良好。现在,我已将网站升级到2018R1,并且自定义字段不再起作用。保存记录后,即使数据库正确保存了值,自定义字段也将变为空白。
I made a DAC extension on CROpportunity in my customization project which was working well in 6.10 and 2017R2. Now I upgraded my site to 2018R1 and my custom fields don't work anymore. As soon as I save my record, the customized field goes blank even if the database saved the value correctly.
为什么会这样?
推荐答案
在版本2018R1中, PX.Objects.CR.CROpportunity
成为 PX.Objects.CR.Standalone.CROpportunity 。
In version 2018R1, PX.Objects.CR.CROpportunity
became a projection of PX.Objects.CR.Standalone.CROpportunity
.
为了使投影正确获取其自定义字段值,您还需要自定义独立DAC,并将 PX.Objects.CR.CROpportunity
的BQL字段设置为 PX.Objects.CR.Standalone.CROpportunity
。
In order for the projection to get its customized fields values correctly, you need to also customize the Standalone DAC and set the BQL Field of PX.Objects.CR.CROpportunity
point to PX.Objects.CR.Standalone.CROpportunity
.
这里是一个示例:
Here is an example :
public class CROpportunityExt : PXCacheExtension<PX.Objects.CR.CROpportunity>
{
#region UsrTest
[PXDBDecimal(BqlField = typeof(CROpportunityStandaloneExt.usrTest))]
[PXUIField(DisplayName="Test Field")]
public virtual Decimal? UsrTest { get; set; }
public abstract class usrTest : IBqlField { }
#endregion
}
public class CROpportunityStandaloneExt : PXCacheExtension<PX.Objects.CR.Standalone.CROpportunity>
{
#region UsrTest
[PXDBDecimal]
[PXUIField(DisplayName="Test Field")]
public virtual Decimal? UsrTest { get; set; }
public abstract class usrTest : IBqlField { }
#endregion
}
这篇关于从6.10或2017R2升级到2018R1后,CROpportunity上的自定义字段不会显示已保存的值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!