Solved

Submit options for Infopath form in sharePoint form Library

Posted on 2014-03-26
7
1,210 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
Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

 
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

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
My Sharepoint challenge 4 47
Licensing Sharepoint 2016 for developers 11 47
Excel 2010:  VBA Question.  Unable to Run Macro. 2 32
VBA - If Bookmark = "XXBOOKMARKXX" then 15 28
Note:  There are two main ways to deploy InfoPath forms:  Server-side and directly through the SharePoint site.  Deploying a server-side InfoPath form means the form is approved by the Administrator, thus allowing greater functionality in the form. …
In this article we discuss how to recover the missing Outlook 2011 for Mac data like Emails and Contacts manually.
This video shows and describes the main difference between both orientations in Microsoft Word. Viewers will understand when to use each orientation and how to get the most out of them.
Learn how to create and modify your own paragraph styles in Microsoft Word. This can be helpful when wanting to make consistently referenced styles throughout a document or template.

773 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