Acumatica - PXDBScalar uniqueidentifier与int不兼容

时间:2018-06-01 02:20:07

标签: acumatica

我尝试使用customer属性的值填充此字段。

  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") { }
    }
}

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

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

1 个答案:

答案 0 :(得分:0)

由于 PXDBScalarAttribute 中使用的当前运算符(Equal<Current<Customer.noteID>>),您似乎收到此错误。

尝试简单地删除当前操作符导致其他错误 无效的列名称'NoteID'。 ,可以通过用Customer.noteID替换PX.Objects.CR.BAccount.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") { }
    }
}
相关问题