Hi Franck,
that sounds like a lot of scripting / repetitive code as you call it on Startup and you call it on the result change as well.
I would change the approach and:
- setup a global variable that is there to simply count the number of data sources that have been loaded
- then - in on Startup you call the background processing
- In the background processing you use if then else and check basically if your global variable is "1" - then you load data source 1; if its "2" then you load data source 2... and so on
- as last step you check if your counter has reached the maximum number of data sources and if not then you increase the value and you call the Background Processing again.
in that way you should need the scripting only in one place.
regards
Ingo