从一般查询访问客户属性

Access Customer Attributes from Generic Inquiry

我需要利用 Customer Attributes in a Generic Inquiry. I devise most of my Generic Inquiries starting with raw SQL in Server Management Studio. I find it much easier to locate the data I need this way. However, I am having a terrible time figuring out how Attributes are tied to Customers. Attributes are added to a Customer Class,然后客户与客户 Class 相关联。这允许该客户 Class 可修改的任何属性。

使用数据库,我发现了以下内容:

因此,人们会期望 CSAnswers table 参考答案所附的客户...但事实并非如此。此 table 定义为:

雪上加霜的是,table 数据库中的名称并不总是与通用查询中可用的名称一一对应。比如一个GI中ARInvoice可用的很多字段,在数据库中实际上是存储在ARRegistertable中的。我怀疑属性正在发生非常相似的事情。

任何人都可以指出我在数据库级别和 GI 级别如何定位属性与客户相关联的正确方向吗?

我已经使用客户属性制作了许多 GI,CSAnswers table 中的 RefNoteID uniqueidentifier 与客户 table 上的 NoteID uniqueidentifier 相关,而 AttributeID 是特定的属性。要在多个行上获取客户的所有属性,请仅在 RefNoteID 上加入,如果您想要特定属性,请为每个 AttributeID 添加额外的加入条件。

属性链接到带有 RefNoteID 字段的记录;它将与另一条记录的 NoteID 匹配(请注意,在您的情况下,它不会在 Customers table 中,而是在 BAccount 中,这是与 Customers 的 1:1 连接)。您应该很少(如果有的话)直接引用 CSAnswers table。在内部,Acumatica 将在主 table 中生成一组与属性名称匹配的虚拟字段,后缀为 _Attributes:

请注意,您将无法在 "Conditions" 选项卡中引用该属性,但您可以在网格中按此列进行过滤并创建预定义过滤器。