Question

Setting Default Save Location in InfoPath Form

Asked by: dfxdeimos

I have a form published to a SharePoint document library that has a workflow attatched to it. When someone navigates to the form and clicks "New" it launches the form, which they then would save back to the library to kick of a workflow that does all sorts of stuff.

When they go to save the form however the default save location is always their document folers, is there a way I can either set the form or the clients to default to the specified sharepoint site for save operations?

I understand you can do something like this via "Submit" features, but I am doing a straight "Save" and do not want to change that operation.

Thanks!

This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.

Subscribe now for full access to Experts Exchange and get

Instant Access to this Solution

  • Plus...
  • 30 Day FREE access, no risk, no obligation
  • Collaborate with the world's top tech experts
  • Unlimited access to our exclusive solution database
  • Never be left without tech help again

Subscribe Now

Asked On
2008-10-30 at 15:14:30ID23863700
Tags

Microsoft

,

InfoPath

,

2007

Topics

Infopath

,

MS SharePoint

,

Windows Vista

Participating Experts
2
Points
500
Comments
23

Trusted by hundreds of thousands everyday for fast, accurate and reliable tech support.

  • "The time we save is the biggest benefit of Experts Exchange to Warner Bros. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange." Mike Kapnisakis, Warner Bros.
  • "Our team likes having a resource that is more secure than just using Google and most experts using this service really know their stuff. It's nice to look here first versus using Google." Dayna Sellner, Lockheed Martin
  • "Anytime that I've been stumped with a problem, 9 out of 10 times Experts Exchange has either the accepted solution or an open discussion of the potential solution to the problem." Kenny Red, eBay Inc.

See what Experts Exchange can do for you.

Got a question?

We've got the answer.

Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.

Screenshot of Experts Exchange Knowledgebase

Need individual assistance?

Our experts are ready to help.

If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.

Screenshot of Experts Exchange Knowledgebase

Want to learn from the best?

Read articles from industry experts.

Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.

Screenshot of an Article

Working on a long term project?

Store your work and research.

Save solutions to your questions, answers you’ve discovered through searching plus helpful articles in your personal knowledgebase for easy future access.

Screenshot of Experts Exchange Knowledgebase

Access the answers to your technology questions today.

Subscribe Now

30-day free trial. Register in 60 seconds.

What Makes Experts Exchange Unique?

Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Trusted by the world's most respected brands.

image of each brand's logo

Faithfully serving IT professionals since 1996.

Experts Exchange Logo

Try it out and discover for yourself.

Subscribe Now

30-day free trial. Register in 60 seconds.

Related Solutions

  1. I need to create an approval workflow in sharepoint with a …
    I need to create an approval workflow in sharepoint with a published infopath form. I have created an infopath form in IP 2003 and am publishing it to a 2007 Sharepoint system. This is a computer request DB so I need to setup approval workflow. How can I do that with the i...
  2. SharePoint Workflows and InfoPath Content Types
    As a beginner project I have created a form in InfoPath. When the user clicks submit, the form generates an xml file and places it in the assigned folder, closing the InfoPath form. Good so far. Now I want to create a workflow in SP Designer that: - Detects a new xml file...
  3. sharepoint three-state workflow with an infopath choice list
    I made an infopath form with a combobox. Is there a way to use this combo box as the choice in the three state workflow?
  4. Infopath Form published in Sharepoint document library
    I've created an Infopath form and published it to a Sharepoint library. For a user to have access to complete a form they must have contribute access to the list. I would like to give users the ability to complete a form, but not give them access to see other user's forms i...
  5. sharepoint workflow with infopath approval form, how do…
    I have a sharepoint workflow that uses an infopath form for the task. Is there a way to get data from the list item that launched the workflow into the infopath form using a recieve connection?
  6. Can I initiate and start an Access data linked Infopath Workfl…
    Hello experts, Can I initiate and start an Access data linked Infopath Workflow form on Sharepoint from Access? Is this possible and if so, what's the best methodology? We have the full MS Office 2007 suite, including Infopath along with Sharepoint 3.0 standard in all loca...

Free Tech Articles

  1. WARNING: 5 Reasons why you should NEVER fix a computer for free.
    It is in our nature to love the puzzle. We are obsessed. The lot of us. We love puzzles. We love the challenge. We thrive on finding the answer. We hate disarray. It bothers us deep in our soul. W...
  2. SCCM OSD Basic troubleshooting
    SCCM 2007 OSD is a fantastic way to deploy operating systems, however, like most things SCCM issues can sometimes be difficult to resolve due to the sheer volume of logs to sift through and the dispe...
  3. Migrate Small Business Server 2003 to Exchange 2010 and Windows 2008 R2
    This guide is intended to provide step by step instructions on how to migrate from Small Business Server 2003 to Windows 2008 R2 with Exchange 2010. For this migration to work you will need the fo...
  4. Create a Win7 Gadget
    This article shows you how to create a simple "Gadget" -- a sort of mini-application supported by Windows 7 and Vista. Gadgets can be dropped anywhere on the desktop to provide instant information, ...
  5. Outlook continually prompting for username and password
    There have been a lot of questions recently regarding Outlook prompting for a username and password whilst using Exchange 2007. There are a few reasons why this would happen and I will try to cover t...
  6. Backup Exchange 2010 Information Store using Windows Backup
    There seems to be quite a lot of confusion around the ability to backup Exchange 2010 using the built in Windows Backup feature. This stems from the omission of this feature prior to Exchange 2007 s...

Cloud Class Webinars

  1. Avoiding Bugs in Microsoft Access
    Alison Balter takes and in-depth look at avoiding bugs in Access. In this webinar you will learn about using the immediate window to debug your applications, invoking the debugger, using breakpoints to troubleshoot, stepping through code, setting the next statement to execute, ...
  2. Top 10 Best New Features in Visio 2010
    Scott Helmers gives live demonstrations of the top 10 new features in Visio 2010. This webinar will teach you how to create compelling diagrams by adding shapes to the page with a single click, linking the shapes in a diagram to data in Excel (or SQL Server, or SharePoint), ...
  3. IT Consultant Business Secrets Revealed
    Michael Munger, Experts Exchange tech pro and IT consultant, pulls back the curtain on his very successful businesses and answers question on every IT consultant and business owner should know about. He shares secrets on what he did to solve the 5 most common problems in IT, ...
  4. Disaster Recovery and Business Continuity
    Quest CTO, Mike Billon, gives an overview of the steps involved in building a dunamic disaster recovery plan. Through case studies and an examination of software/hardware tooles for monitoring and testing, you'll gain a better understandin of where you are, where you want ...
  5. Organize Your Visio Diagrams with Containers and Lists
    Scott Helmers uses cross functional flowcharts, wireframe diagrams, data graphic legends and seating charts to teach you: how to ustilize all three new structured diagram components in Visio 2010, the best practices for organizeing shapes in previous version of Visio, how to organize ...
  6. How to Us Objects, Properties, Events and Methods in Microsoft Access
    Alison Dalter gives an in-depbth look at objects, properties, events and methods in Microsoft Access. In this webinar you will learn about using the object browser, referring to objects, working with properties and methods, working with object variables, understanding the ...

Join the Community

Give a Little. Get a Lot.

Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.

Join the Community

Answers

 

by: CloudedTurtlePosted on 2008-10-31 at 05:39:29ID: 22849408

I believe that in order to do this without using a submit button, would be to specify custom Save code. This of course means that you need to use managed code to create the new save event to do whatever you want.

I'm not sure what your reservations are about changing to a submit, but depending on your skill level with .NET programming, it might be simpler to go with a submit, vs. custom code.

I am still doing some digging on this, and will let you know if there are any other options that  I find.

 

by: clayfoxPosted on 2008-10-31 at 07:17:35ID: 22850277

This is pretty simple.

Save is on the toolbar. In form options you can remove this and they just use the submit button instead. Or add a button on the bottom of the form and call it save or whatever you want.

The benefit for the user is that the action is one click, rather then having to name the file, possibly save it somewhere else by mistake, etc.

Create a submit data connection using the wizard to the Sharepoint library.  Use fields in the form and maybe the date, etc to create a standard naming scheme for each document.

This is best practice since save cannot be controlled or ensured.

 

by: dfxdeimosPosted on 2008-10-31 at 11:04:21ID: 22852639

I understand what you are saying about the submit functions, but that is not an option in this situation.

I am working in an environment that is built to some exact procedural specifications as to how operations are completed. The current procedures demand that a save is used instead of a Submit (not my choice / under my control).

I know this is possible, as I have seen it in other forms I have dealt with in the past.

Thank you.

 

by: clayfoxPosted on 2008-11-02 at 23:04:06ID: 22865016

I believe then you would have to use code to set the path and filename as cloudedturtle states.

 

by: CloudedTurtlePosted on 2008-11-03 at 05:31:45ID: 22866850

To make this change using custom code, do the following:

  • Goto Tools Menu, select Form Options 
  • On the Open and Save category check the checkbox in the "Save Behavior" section that reads "Save using custom code" 
  • then click the "Edit" button. 

Below is a snippet of sample code in VB that we give you your desired change. This is the full sub for the save, the important part in the "SetSaveAsDialogLocation" function...

Good luck!

Public Sub FormEvents_Save(ByVal sender As Object, ByVal e As SaveEventArgs)
            ' Write your code that will run before a Save or Save As operation here.
 
            SetSaveAsDialogLocation("c:\")
 
            ' The Dirty property will be set to false if save is successful.
 
            e.PerformSaveOperation()
 
            ' Write your code that will run after saving here.
 
            e.CancelableArgs.Cancel = False
        End Sub

                                              
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:

Select allOpen in new window

 

by: dfxdeimosPosted on 2008-11-03 at 10:50:45ID: 22869735

Thank you for your suggestion. Just to clarify, when you click the "Edit" button to insert the custom code you posted, InfoPath has some pre-populated code in there. I wanted to be sure I should add this in the place indicated (it has a placeholder, something like "\\Nothing Here"). The resulting code looked like this:

/*
 * This file contains functions for data validation and form-level events.
 * Because the functions are referenced in the form definition (.xsf) file, 
 * it is recommended that you do not modify the name of the function,
 * or the name and number of arguments.
 *
*/
 
// The following line is created by Microsoft Office InfoPath to define the prefixes
// for all the known namespaces in the main XML data file.
// Any modification to the form template files made outside of InfoPath
// will not be automatically updated.
//<namespacesDefinition>
XDocument.DOM.setProperty("SelectionNamespaces", 'xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:dfs="http://schemas.microsoft.com/office/infopath/2003/dataFormSolution" xmlns:tns="http://contoso.com/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:my="http://schemas.microsoft.com/office/infopath/2003/myXSD/2006-12-04T16:19:23" xmlns:xd="http://schemas.microsoft.com/office/infopath/2003"');
//</namespacesDefinition>
 
 
//=======
// The following function handler is created by Microsoft Office InfoPath.
// Do not modify the name of the function, or the name and number of arguments.
//=======
function XDocument::OnLoad(eventObj)
{
	try
	{
		var CreateAccountData = XDocument.DataObjects["CreateAccount"];
		var CreateAccountAdapter = CreateAccountData.QueryAdapter;
		CreateAccountAdapter.Timeout = 120;
	}
	catch(e)
	{
		Public Sub FormEvents_Save(ByVal sender As Object, ByVal e As SaveEventArgs)
            ' Write your code that will run before a Save or Save As operation here.
 
            SetSaveAsDialogLocation("C:\Location\I\Am\Saving\To")
 
            ' The Dirty property will be set to false if save is successful.
 
            e.PerformSaveOperation()
 
            ' Write your code that will run after saving here.
 
            e.CancelableArgs.Cancel = False
        End Sub
	}
}
 
//=======
// Die folgende Handlerfunktion wurde von Microsoft Office InfoPath erstellt.
// Der Funktionsname und die Anzahl und Namen der Argumente dürfen nicht geändert werden.
//=======
function XDocument::OnSaveRequest(eventObj)
{
	// Erstellen Sie hier den Code, der vor dem Speichern ausgeführt werden soll.
 
	eventObj.IsCancelled = eventObj.PerformSaveOperation();
 
	// Erstellen Sie hier den Code, der nach dem Speichern ausgeführt werden soll.
 
	eventObj.ReturnStatus = true;
 
}
                                              
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:

Select allOpen in new window

 

by: CloudedTurtlePosted on 2008-11-03 at 11:02:10ID: 22869842

To start, it looks like you are using C# as your code base, so the code that I included will need to be updated with the C# equivelant.

Using the code snippet about, you should add the following code on line 5 in the function XDocument::OnSaveRequest(eventObj) section:

XDocument.SetSaveAsDialogLocation("C:\\"); (replacing C:\\ with whatever your path is. Besure to replace any \ with a double "\\".

 

by: dfxdeimosPosted on 2008-11-03 at 11:30:31ID: 22870082

Thank you for your quick response.

To confirm my code now looks like the following:

/*
 * This file contains functions for data validation and form-level events.
 * Because the functions are referenced in the form definition (.xsf) file, 
 * it is recommended that you do not modify the name of the function,
 * or the name and number of arguments.
 *
*/
 
// The following line is created by Microsoft Office InfoPath to define the prefixes
// for all the known namespaces in the main XML data file.
// Any modification to the form template files made outside of InfoPath
// will not be automatically updated.
//<namespacesDefinition>
XDocument.DOM.setProperty("SelectionNamespaces", 'xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:dfs="http://schemas.microsoft.com/office/infopath/2003/dataFormSolution" xmlns:tns="http://contoso.com/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:my="http://schemas.microsoft.com/office/infopath/2003/myXSD/2006-12-04T16:19:23" xmlns:xd="http://schemas.microsoft.com/office/infopath/2003"');
//</namespacesDefinition>
 
 
//=======
// The following function handler is created by Microsoft Office InfoPath.
// Do not modify the name of the function, or the name and number of arguments.
//=======
function XDocument::OnLoad(eventObj)
{
	try
	{
		var CreateAccountData = XDocument.DataObjects["CreateAccount"];
		var CreateAccountAdapter = CreateAccountData.QueryAdapter;
		CreateAccountAdapter.Timeout = 120;
	}
	catch(e)
	{
		// Do nothing currently.
	}
}
 
//=======
// Die folgende Handlerfunktion wurde von Microsoft Office InfoPath erstellt.
// Der Funktionsname und die Anzahl und Namen der Argumente dürfen nicht geändert werden.
//=======
function XDocument::OnSaveRequest(eventObj)
{
	// Erstellen Sie hier den Code, der vor dem Speichern ausgeführt werden soll.
 
	eventObj.IsCancelled = eventObj.PerformSaveOperation();
	
	XDocument.SetSaveAsDialogLocation("http://intranet.mycompany.com/Departments/Personal/Forms/FormLibrary");
 
	// Erstellen Sie hier den Code, der nach dem Speichern ausgeführt werden soll.
 
	eventObj.ReturnStatus = true;
 
}

                                              
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:

Select allOpen in new window

 

by: CloudedTurtlePosted on 2008-11-03 at 11:33:33ID: 22870105

That looks correct, be sure to preview and test the form before moving to production.

:-D

 

by: dfxdeimosPosted on 2008-11-03 at 11:34:15ID: 22870110

Hmm, this didn't seem to work as I expected. After re-publishing the form and re-opening it to create a new record it still defaults to the user's Documents folder.

Do I need to use a different syntax if my save location is a SharePoint Document Library instead of a local location?

 

by: CloudedTurtlePosted on 2008-11-03 at 11:45:23ID: 22870207

..did you debug the code in the VS editor before publishing it?

Remove the XDocument prefix for the line that you added.. Final line should look like the code below...

Sorry, I didn't debug the code myself...
Before republishing, press F5 in the VS Code editor.. this should load the form in preview mode and you should be able to select Save and verify that it is working before publishing the form..


 

SetSaveAsDialogLocation(http://intranet.mycompany.com/Departments/Personal/Forms/FormLibrary);

                                              
1:

Select allOpen in new window

 

by: dfxdeimosPosted on 2008-11-03 at 11:57:24ID: 22870330

I do not seem to have a "Debug" option in the "Microsoft Script Editor" that InfoPath opens up to create this code...

 

by: CloudedTurtlePosted on 2008-11-03 at 11:59:54ID: 22870367

..okay.. Well then you should still be able to preview the form and test the functionality before you re-publish this form.. just saves you the work have publishing something that may not work.. and having to republish again, and again... :-)

 

by: dfxdeimosPosted on 2008-11-03 at 12:11:15ID: 22870488

Ok, when I preview the form with the line you specified in it, it still defaults to the user's Documents. If I hit cancel an error comes up saying there is a problem in the script.js file and asking me if I want to debug it. If I select yes, Visual Studio opens up the code, highlights the code line that we put in and gives the error "Microsoft JScript runtime error: Object expected"

I took a guess and also tried it with the "eventObj." prefix added to the line and it gave me an error that said the object didn't support that method.

Thank you again for taking the time to assist me with this, I really appreciate it.

 

by: CloudedTurtlePosted on 2008-11-03 at 12:36:12ID: 22870799

..Okay.. Last shot, I think that this will do it.. you're line of code should look like this..

I have tested this and it seems to function as expected on my system.

XDocument.UI.SetSaveAsDialogLocation(http://intranet.mycompany.com/Departments/Personal/Forms/FormLibrary/);
                                              
1:

Select allOpen in new window

 

by: dfxdeimosPosted on 2008-11-03 at 13:05:40ID: 22871108

Hmm...

I have tried it with both:

XDocument.UI.SetSaveAsDialogLocation(http://intranet.mycompany.com/Departments/Personal/Forms/FormLibrary/);

and

UI.SetSaveAsDialogLocation(http://intranet.mycompany.com/Departments/Personal/Forms/FormLibrary/);

and it doesn't change the default "Save As" location. On the plus side I don't get the errors I was getting with the other lines.

 

by: CloudedTurtlePosted on 2008-11-03 at 13:10:26ID: 22871151

..Sorry... I am terrible at proof reading.. you need to surround your path with quotes ("path")

XDocument.UI.SetSaveAsDialogLocation("http://intranet.mycompany.com/Departments/Personal/Forms/FormLibrary/");

                                              
1:

Select allOpen in new window

 

by: dfxdeimosPosted on 2008-11-03 at 13:14:17ID: 22871188

No worries, I included those anways.

Still a no go. I only have to check the box "Save using custom code" in order to activate the custom code, correct?

The complete code is as follows:

/*
 * This file contains functions for data validation and form-level events.
 * Because the functions are referenced in the form definition (.xsf) file, 
 * it is recommended that you do not modify the name of the function,
 * or the name and number of arguments.
 *
*/
 
// The following line is created by Microsoft Office InfoPath to define the prefixes
// for all the known namespaces in the main XML data file.
// Any modification to the form template files made outside of InfoPath
// will not be automatically updated.
//<namespacesDefinition>
XDocument.DOM.setProperty("SelectionNamespaces", 'xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:dfs="http://schemas.microsoft.com/office/infopath/2003/dataFormSolution" xmlns:tns="http://contoso.com/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:my="http://schemas.microsoft.com/office/infopath/2003/myXSD/2006-12-04T16:19:23" xmlns:xd="http://schemas.microsoft.com/office/infopath/2003"');
//</namespacesDefinition>
 
 
//=======
// The following function handler is created by Microsoft Office InfoPath.
// Do not modify the name of the function, or the name and number of arguments.
//=======
function XDocument::OnLoad(eventObj)
{
	try
	{
		var CreateAccountData = XDocument.DataObjects["CreateAccount"];
		var CreateAccountAdapter = CreateAccountData.QueryAdapter;
		CreateAccountAdapter.Timeout = 120;
	}
	catch(e)
	{
		// Do nothing currently.
	}
}
 
//=======
// Die folgende Handlerfunktion wurde von Microsoft Office InfoPath erstellt.
// Der Funktionsname und die Anzahl und Namen der Argumente dürfen nicht geändert werden.
//=======
function XDocument::OnSaveRequest(eventObj)
{
	// Erstellen Sie hier den Code, der vor dem Speichern ausgeführt werden soll.
 
	eventObj.IsCancelled = eventObj.PerformSaveOperation();
	XDocument.UI.SetSaveAsDialogLocation("http://intranet.mycompany.com/Departments/Personal/Forms/FormLibrary/");
 
	// Erstellen Sie hier den Code, der nach dem Speichern ausgeführt werden soll.
 
	eventObj.ReturnStatus = true;
 
}
                                              
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:

Select allOpen in new window

 

by: CloudedTurtlePosted on 2008-11-03 at 13:18:21ID: 22871236

Exact code should be below... you have the new line in the wrong order, you need to set the path location before you perform the save function..

 

/*
 * This file contains functions for data validation and form-level events.
 * Because the functions are referenced in the form definition (.xsf) file, 
 * it is recommended that you do not modify the name of the function,
 * or the name and number of arguments.
 *
*/
 
// The following line is created by Microsoft Office InfoPath to define the prefixes
// for all the known namespaces in the main XML data file.
// Any modification to the form template files made outside of InfoPath
// will not be automatically updated.
//<namespacesDefinition>
XDocument.DOM.setProperty("SelectionNamespaces", 'xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:dfs="http://schemas.microsoft.com/office/infopath/2003/dataFormSolution" xmlns:tns="http://contoso.com/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:my="http://schemas.microsoft.com/office/infopath/2003/myXSD/2006-12-04T16:19:23" xmlns:xd="http://schemas.microsoft.com/office/infopath/2003"');
//</namespacesDefinition>
 
 
//=======
// The following function handler is created by Microsoft Office InfoPath.
// Do not modify the name of the function, or the name and number of arguments.
//=======
function XDocument::OnLoad(eventObj)
{
	try
	{
		var CreateAccountData = XDocument.DataObjects["CreateAccount"];
		var CreateAccountAdapter = CreateAccountData.QueryAdapter;
		CreateAccountAdapter.Timeout = 120;
	}
	catch(e)
	{
		// Do nothing currently.
	}
}
 
//=======
// Die folgende Handlerfunktion wurde von Microsoft Office InfoPath erstellt.
// Der Funktionsname und die Anzahl und Namen der Argumente dürfen nicht geändert werden.
//=======
function XDocument::OnSaveRequest(eventObj)
{
	// Erstellen Sie hier den Code, der vor dem Speichern ausgeführt werden soll.
	
	//Set Save As location
	XDocument.UI.SetSaveAsDialogLocation("http://intranet.mycompany.com/Departments/Personal/Forms/FormLibrary/");
 
	//Perform SAVE function 
	eventObj.IsCancelled = eventObj.PerformSaveOperation();
	
 
	// Erstellen Sie hier den Code, der nach dem Speichern ausgeführt werden soll.
 
	eventObj.ReturnStatus = true;
 
}

                                              
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:

Select allOpen in new window

 

by: dfxdeimosPosted on 2008-11-03 at 13:33:18ID: 22871401

I am at a loss here... I plugged in the code that you posted in the previous message and I am still having the problem. No errors / debug messages but no success.

Do you know if there is a spot in the InfoPath program itself to specify the default save location for ALL forms? This is the only form that we will be using so that is an option as well.

 

by: CloudedTurtlePosted on 2008-11-03 at 19:13:59ID: 22873310

I am not sure what is going on either, but everything as I can tell should be working fine. I don't know of any way to set the default location for all forms.

Unfortunately, I can't think of anything short of uploading your form, or remote accessing your PC that would help is resovling this problem.

You may be better off working with the process owner in the possibilities of using a custom submit function cleverly disguised as a Save button.  One caveate in only changing the default save path, is that the users can still over-write this path and save anywhere they like, it doesn't offer the same level of security that I suspect you are looking for...

Sorry I can't be more of a help.

 

by: dfxdeimosPosted on 2008-11-04 at 10:57:17ID: 22879294

Well, thank you for your help and suggestions. I really appreciate your time! =]

 

by: dfxdeimosPosted on 2008-11-04 at 10:58:37ID: 31511886

I just figured I would award you the points for all the help you gave me. I am sure that anyone else searching for a solution for a custom save script would find your posts helpful.

Thank you again.

20120131-EE-VQP-002

3 Ways to Join

30-Day Free Trial

The Experts

98% positive feedback on 31,087 answers since March 2000. angeliii is a Microsoft Most Valuable Professional for his work with MS SQL Server & Develoment.

He has also proven his knowledge of Visual Basic Programming, PHP Scripting and Oracle Databases.

The Experts

97% positive feedback on 10,752 answers since July 2000. lrmoore has more than 18 years experience in the networking industry.

The six-time Mircosoft MVPs specialties include firewalls, virtual private networking, and network management.

Testimonials

"...and excellent source for support... Kind of like having your very own IT dept." Electriciansnet

Testimonials

"I was apprehensive at signing up at first. However... it has already made my life as an IT administrator much easier." JaCrews

Testimonials

"WOW! You guys have great, active, and knowledgeable people on here." moore50

Business Clients

Business Clients

In the Press

"If you’ve got a question... Experts Exchange can supply an answer.”

In the Press

"...an invaluable aid for both IT professionals and those who require tech support."

In the Press

"where IT professionals provide quick answers on just about any topic"

Business Account Plans

Loading Advertisement...