I have a form where I need to perform a calculation on the "UnitPrice", which is passed in the XML. Normally, this works fine. There are some cases, however, where pricing is supressed. In these cases, the UnitPrice comes over nilled:
<UnitPrice xsi:nil="true"/>
This causes an error in the form and will not generate. I had tried, with no success, to come up with a way to handle this previously in XPath. I finally gave up and waited for the new scripting functionality to be release, but I cannot seem to come up with a way to do this in scripting, either. Any thoughts on how to perform this calculation only if UnitPrice has a valid numeric value?
As a side note, while working this issue, I did come across what I believe to be a bug in the scripting engine, and I have opened a ticket. The issue is with the "length" function, which is a documented, supported function.
length("abc") returns a 3 as expected
length("ab3") also returns 3 as expected
length("123") will throw an error (Yes, it is a number, but it is being presented a string, in quotes, that just happens to be a number).
length("1.23") will also throw an error