Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / General MS InfoPath Questions / January 2007

Tip: Looking for answers? Try searching our database.

Form configuration

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Marshall Harrison [OCS MVP] - 23 Jan 2007 19:04 GMT
We have a form that a contractor developed for us but some of the form
variables are hard coded. For example the SharePoint URL is hard coded as
are the email address list. I've inherited all InfoPAth development and all
the hard coded stuff  makes it difficult when moving form changes from DEV
to QA to Production.

Is there a way to have the form read an include or web.config file on form
load so that these variables are set properly. What I envision is a separate
config file for each of DEV, QA and PROD each with the appropriate values
for the environment. That way the form could be moved through the cycle
without have to make changes - simply keep separate configs.

Any suggestion will be appreciated.

Signature

Marshall Harrison
Microsoft MVP - Office Communications Server
Email: marshall@GotSpeech.Net
Web: www.GotSpeech.Net
Blog: http://gotspeech.net/blogs/marshallharrison/default.aspx

S.Y.M. Wong-A-Ton - 24 Jan 2007 05:16 GMT
You can create an XML file containing the configuration settings. Add this
file as a resource file to your form template (Tools > Resource Files). Then
create a data connection to the resource file (Tools > Data Connections > Add
> Receive data > XML document > Resource files). You can now access this data
source from within the OnLoad event of your form (search the newsgroup for
code samples). To update your configuration file, go to Tools > Resource
Files, select the file, click on Export, modify it, then add it back again to
your form by replacing the old file.

Another option is to put the configuration file on one location that is
accessible by all users and then not include it in your form template. This
way you can update the configuration settings externally without having to
update the resource file in the form template itself. But again, users must
have access to the location of the config file.
---
S.Y.M. Wong-A-Ton

> We have a form that a contractor developed for us but some of the form
> variables are hard coded. For example the SharePoint URL is hard coded as
[quoted text clipped - 9 lines]
>
> Any suggestion will be appreciated.
Marshall Harrison [OCS MVP] - 24 Jan 2007 13:10 GMT
Thanks for the information.

Two quick questions.

1. If I place the file on the SharePoint server where the form is located
then will it be loaded properly by every user?
2. I assume the path would have to be fully qualified so that when the form
is run on the user's local machine the OnLoad event will find the file. Is
that correct?

Signature

Marshall Harrison
Microsoft MVP - Office Communications Server
Email: marshall@GotSpeech.Net
Web: www.GotSpeech.Net
Blog: http://gotspeech.net/blogs/marshallharrison/default.aspx

> You can create an XML file containing the configuration settings. Add this
> file as a resource file to your form template (Tools > Resource Files).
[quoted text clipped - 36 lines]
>>
>> Any suggestion will be appreciated.
S.Y.M. Wong-A-Ton - 25 Jan 2007 07:51 GMT
1. Theoretically (because I haven't tested it), if every user has access to
the file on SharePoint and SharePoint itself has access to the data source,
then yes. I do not have a proper environment set up to test it for you, so
you'll have to give it a go and see if it works.
2. The path is always fully qualified. If you extract the form files and
search the manifest.xsf for dataObjects, you'll see an xmlFileAdapter with a
fileURL listed; there is where InfoPath gets the path from. You access the
data object by its name and not by its location from within the OnLoad event.
---
S.Y.M. Wong-A-Ton

> Thanks for the information.
>
[quoted text clipped - 46 lines]
> >>
> >> Any suggestion will be appreciated.
Marshall Harrison [OCS MVP] - 25 Jan 2007 18:41 GMT
Thanks.

I'll give all this a try later today.

> 1. Theoretically (because I haven't tested it), if every user has access
> to
[quoted text clipped - 73 lines]
>> >>
>> >> Any suggestion will be appreciated.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.