Drive a SQL drop list with file datas

Hi there,

I'm trying to use the lists from SQL base.

Actually I can display values in the card of a file, but these values don't refer to this file.

Here's the whole story:

I have created a database where I set purchasing datas, refering to the DocumentID of my file (this is easy to extract!)

On the query below, I set the information I need into a list, which I will display in the card of the file

The issue is that the DocumentID is hand written and so, it works only with the ID #8000

So, how to get dynamically the ID of the file where it will be displayed?

SolidworksSolidworks Pdm enterprise Pdm