I would like to have a form that has a few data connections to a web service. The form will be available offline as well but there is no need. No need to setup a resource file to reference the pull downs. What I plan on doing is OnLoad, use IsDestinationReachable to see if the webservice can be reached. If it can, then setup the data connection to the web service (Note: This is an actual setup where code is used instead of going into Tools\Data Connections... ). If it cannot establish a connection, pull up a detailed popup indicating some pull downs won't work but you can use them when you get online.
function XDocument::OnLoad(eventObj)
{
if (0==Application.IsDestinationReachable(http:// --web service's website--))
{ XDocument.UI.Alert("The server is unavailable."); }
else
{ XDocument.UI.Alert("The server is available."); }
}
Question: Is there a way to code a data connection setup? I performed a search but only could find this thread which didn't provide much information. http://www.infopathdev.com/forums/thread/13100.aspx
Overall, the goal is to allow the template to open when a data connection is not present w/out using a xml resource. The above is my attempt at this.
Thanks!
Don't grow old regretting the things you didn't do.