Archive

Posts Tagged ‘jscript’

InfoPath: A proper way to blank out Whole Number, Date using JScript

April 29th, 2010 No comments

Problem:

When you blank out data in InfoPath using JScript, you would probably use the following method.

XDocument.DOM.selectSingleNode("my:xpath/my:node").text = "";

Above code works well when “my:node” is of data type String. If the data type is Number or Date, above code will work but on the user interface you will see an error “Only integers allowed.” and “Only date allowed.”

Only integer allowed Read more…

Categories: Infopath Tags: , , ,

InfoPath Error: Reference to undeclared namespace prefix “dfs”

March 17th, 2010 3 comments

Error:

If you are trying to get/set values using XPath on Secondary Data Source, you might get the error “Reference to undeclared namespace prefix: dfs”.

Cause:

When you are trying to use XPath expression on Secondary Data Source, you must have to declare the namespace that is going to be used in the code. By default, InfoPath does NOT add namespace for Secondary Data Source. You have to add it manually.

Resolution: Read more…