On the weekend I was doing a little work for someone who was in the process of upgrading to BE15, and ISO10.1 when I came across a rather odd issue. It prompted me to upgrade my test environment Smart Office to 10.1 – an interesting and somewhat enlightening process I might add.
They had a script that would retrieve the customers name from OIS101 and use that as an argument in a call to another program – and under ISO10.1 instead of getting the customers name, they got some text back saying “System.Window.Controls.TextBlock”.
With a little investigation, it turns out that Smart Office now has a TextBlock within the labels Content property where we traditionally would have had a string. So now we need to dig a little deeper to retrieve the actual text content.
So, after my upgrade I looked at reproducing and documenting the issue – excuse the eye bleeding orange…err…coral.
Traditionally I could have simply gone out and done this:
var lblCustomerName : Label = ScriptUtil.FindChild(content, "LBL_L26T2"); MessageBox.Show("Customer Name: '" + lblCustomerName.Content + "'");
However, this yields
I’m sure that there is some witty comment that could be said here but meh…
If we’re really lazy, then we can change our code to this:
var lblCustomerName : Label = ScriptUtil.FindChild(content, "LBL_L26T2"); MessageBox.Show("Customer Name: '" + lblCustomerName.Content.Text + "'");
…which provides something a little more like we expect.
Guess it highlights the old “test, test and test” 🙂