AnsweredAssumed Answered

Access Fields in a table linked in AF

Question asked by ebelaski on Jun 13, 2016
Latest reply on Jun 13, 2016 by ebelaski

Hello Community,

I have started on on my first Dev / AF project and have a question regarding both implementation and best practices.

I created an AF model using a template to access PI points and other attributes. This template has several attributes that are using a table lookup data reference to a linked table to an external SQL Server database. Currently, In the linked table I have 15 fields that I will eventually like to have access to as metadata to the PI data information but I have only created data reference attributes in the AF template for two of the fields. I created a view in SQL Commander (DataT database)  that accesses the PI point data as well as the two attributes that use the table lookup data reference. In my C# .NET web application I am able to query this view and display both the PI data and the attribute data.


My questions are:

1. Is there a method through AFSDK to query the Linked table directly from the .NET application to pull the Linked table information along with the AF data without the need to create a data reference attribute for each field that is desired in the result set?

2. What is the best practice of retrieving data from PI if data from an external database is also needed to provide metadata? I would like to do this in one query if possible rather than two queries that need to be programmatically joined. The external database is relatively small, containing only several thousand records.


Thanks for your suggestions.