Solved

Submit options for Infopath form in sharePoint form Library

Posted on 2014-03-26
7
1,168 Views
Last Modified: 2014-03-27
I have created an expense report form by creating an infopath template (.xsn), and I am using that template for new form submission to a SharePoint doc library. Each doc gets named on submit by contatonating the user name with the date. This works great. But if the same person opens it on the same day and edits it, or if they try to create a new one on the same day, it won't submit because it has the same file name. Here's what I would like to happen.

I can change the on submit file naming to include the time, to take care of naming problems. But i need a system for the submit button that recognizes a new submission and submits it, or overwrites the old file if it is not a new submission. It seems like the submit action always thinks it's a new submission. Users could use the save button and I could wipe the submission button out, although I like it because it's obvious to the users, but when they are creating a new form, the save button seems to want to save locally, not to SharePoint. So it looks like the users would have to know to use the submit button if they wish to add a new form entry, and the save button if they want to edit it. That doesn't sound user friendly to me.

So what's the best way to handle something like this? I would like to either make the save button do both things that I want or the submit button, but i would rather that the users don't have to choose which to use given the situation.
0
Comment
Question by:BobHavertyComh
  • 4
  • 3
7 Comments
 
LVL 28

Assisted Solution

by:clayfox
clayfox earned 500 total points
ID: 39957228
1. You always want to use a button with a submit action so that you can control the naming, etc.
2. you should have a field in your schema that concatenates the values instead of doing it in the data connection, this provides more control.
2. In the Form Library Properties you can specify if overwriting files is allowed, but I do not think you want the first one getting overwritten in this scenario.
3. You can create a receive data connection to the form library and check if the name has been used already and have an action that sets a one to the filename or what ever to make it unique.
4. You could add the time to the file name, concatenate (substring-after(now(),"T") to get the current time.
0
 
LVL 28

Accepted Solution

by:
clayfox earned 500 total points
ID: 39957233
Also they could certainly open an existing form and edit and submit again, that is why you want to control the file name and have it in the form rather than compile each submit.
You can have a rule that if filename is blank, set the value, otherwise it would stay the same and that would be the same filename when it submits a second time.  Need to allow overwrite in the library.
0
 
LVL 9

Author Comment

by:BobHavertyComh
ID: 39959569
2. you should have a field in your schema that concatenates the values instead of doing it in the data connection, this provides more control.

I think i understand what you are saying, but don't know exactly how to go about it. i can create an empty title field in the schema and keep it hidden from the form, but how would this relate to it's title in SharePoint? It sounds like I am creating a field to hold the file name. but how does that field go from the value it gets set to, to naming the document?
0
How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

 
LVL 9

Author Comment

by:BobHavertyComh
ID: 39959593
Also. I am trying to add a rule to the submit button as it seems like you can only add a rule to a control, but with the submit button selected, the actions portion of the rule behavior is greyed out and doesn't let me add one
0
 
LVL 28

Expert Comment

by:clayfox
ID: 39959791
Need to make the button type rules and code rather than submit. Submit type is a one trick pony and a waste.
0
 
LVL 9

Author Closing Comment

by:BobHavertyComh
ID: 39959855
Creating rules for the form itself didn't work at first. I created a field named filename to hold the value of the filename for the submit button to use to name the file on submit. That didn't seem to set it and it gave me an error that it can't name it an empty file name. Made tyhe same rule for form load instead and this worked. If it's empty on load, set a value, or else this is an edit rather than a new form and do nothing with the filename field and leave as is. Then submit comes by and grabs whatever value that is in there which will never be empty. Form submit also set to overwrite. So I think that does it.
0
 
LVL 9

Author Comment

by:BobHavertyComh
ID: 39959862
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

In case Office 2010 has not been deployed in your environment, this article may be quite useful. In our office, we wanted a way to deploy Microsoft Office Professional Plus 2010 through an automated batch file via logon script. This article is docum…
No matter the version of Windows you are using, you may have some problems with Windows Search running too slow or possibly not running at all. Before jumping into how you can solve this issue, just know there are many other viable alternative deskt…
The viewer will learn how to  create a slide that will launch other presentations in Microsoft PowerPoint. In the finished slide, each item launches a new PowerPoint presentation and when each is finished it automatically comes back to this slide: …
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now