Skip to main content



How to correctly assign to a named data source (BT 10.1 SR4)



  • Avatar
    Jasper Wen

    The method Format.NamedSubStrings("mydatasource").Value is intended to be used to set and get values of named data sources on the label design. Do note that OnAutoSelectedEvent is called whenever the value of the data source is needed.

    I was successfully able to replicate the issue in v10.1 SR4 by doing the following:

    1. Created two named data sources named "mydatasource" and "mydatasource2"

    2. Create a new text object with a data source using vbscript on event control scripts and OnAutoSelectedEvent using the vbscript code:

    Format.NamedSubStrings("mydatasource").Value = "test"
    Format.NamedSubStrings("mydatasource2").Value = "test2"

    I can see the value return "script endless loop" message. Like you mentioned, everything still appears to work correctly.

    However, I tried the same thing in our latest version 2016 R4, and the issue doesn't replicate so it seems something that was fixed in 2016.

  • Avatar

    Hi Jasper

    Many thanks for your helpful response. It's good to hear that this method is intended to be used the way I did - otherwise I would have had to change this in a lot labels... :-)

    One more thing I forgot to mention: The error message does not appear if I assign to the data source like this:

    MYDATASOURCE = "test"

    However, that only works if the data source name is capitalized and does not contain any special characters (hence why I prefer Format.NamedSubStrings).


Please sign in to leave a comment.