Search code examples
sqlwindev

WinDev - Using a variable in a Looper Content Query


I am hoping someone will be able to point me in the right direction. I have a Looper control within WinDev and am filling the Content using a Query.

How do I utilise a global variable within the query? It seems that it must be passed in as a parameter to the query, however there is no opportunity to set the parameter unless executing the query from code. It all seems a little contradictory and I am sure I'm missing something obvious.

UPDATE

Having read about MySource but also read that MySource cannot be utilised in an Initialization block; I have moved the query to independent. Thereby allowing me to set the parameter with

Query name.Parameter = Value

However, although the Query is specified in the Content table of the Looper control, it does not seem to return anything.

Have tried calling HExecuteQuery() and LooperDisplay(), neither of which seem to do anything.

The query is a simple select and works when tested in the query editor.

Any help would be greatly appreciated,


Solution

  • It turns out that I had to go into the Description of each field and re-click the Link entry. Nothing changed as I clicked them but the data now appears.

    Not a great solution but it resolved the issue :-(