【问题标题】:Acumatica - PXDBScalar uniqueidentifier is incompatible with intAcumatica - PXDBScalar uniqueidentifier 与 int 不兼容
【发布时间】:2018-06-01 13:00:42
【问题描述】:

我正在尝试使用客户属性的值填充此字段。

  public class CustomerExt : PXCacheExtension<Customer>
  {
    #region OtherID
    [PXString]
    [PXUIField(DisplayName = "Other ID")]
    [PXDBScalar(typeof(Search<CSAnswers.value,
        Where<CSAnswers.refNoteID, Equal<Current<Customer.noteID>>,
            And<CSAnswers.attributeID, Like<OtherIDAttr>>>>))]
    public virtual string UsrOtherID { get; set; }
    public abstract class usrOtherID : IBqlField { }
    #endregion 

    public class OtherIDAttr: Constant<string>
    {
        public OtherIDAttr() : base("OTHERID") { }
    }
}

将字段添加到屏幕时会导致上述错误。如果我从 Search 中删除第二个条件,则会填充该字段,因此我确定它是 CSAnswers AttributeID 和常量字符串之间的比较。

如果有人能指出我正确的方向,那就太棒了。

【问题讨论】:

    标签: acumatica


    【解决方案1】:

    您收到此错误的原因似乎是 PXDBScalarAttribute 中使用了 Current 运算符 (Equal&lt;Current&lt;Customer.noteID&gt;&gt;)。

    尝试简单地删除 Current 运算符会导致另一个错误Invalid column name 'NoteID'。,可以通过用PX.Objects.CR.BAccount.noteID替换Customer.noteID

    public class CustomerExt : PXCacheExtension<Customer>
    {
        #region OtherID
        public abstract class usrOtherID : IBqlField { }
    
        [PXString]
        [PXUIField(DisplayName = "Other ID")]
        [PXDBScalar(typeof(Search<CSAnswers.value,
            Where<CSAnswers.refNoteID, Equal<BAccount.noteID>,
                And<CSAnswers.attributeID, Like<OtherIDAttr>>>>))]
        public virtual string UsrOtherID { get; set; }
        #endregion
    
        public class OtherIDAttr : Constant<string>
        {
            public OtherIDAttr() : base("OTHERID") { }
        }
    }
    

    【讨论】:

    • 谢谢伙计。像魅力一样工作
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-08-09
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多