Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 543
  • Last Modified:

Simple Automation with Infopath 2003 and SPS 3.0 - Calculate Directory / Filename to save as

I have a simple Infopath Form with various text fields, date fields, option buttons, etc.  I have published to form to a sharepoint "server" (actually, a server running SPS 3.0 -- the free version).  I would like to add two command buttons (say "btnDrafts" and "btnSubmit"), with the caption "Save As Draft" and "Submit to Policy Committee".  

If the user clicks on btnDraft, the form would be saved in a Drafts subfolder of the current location of the empty template, in SPS, with a concatenation of the last name of the author (txtAuthorLastName (textbox)), the title of the policy (txtTitle), the current system date (in YYYYMMDD) format, and the letters "DRF" (e.g., DoeWorkHours20091230DRF).

If the user clicks on btnSubmit, the form would be saved in a "Submit to Policy Committee" subfolder of the current location of the empty template, in SPS, with the same name, except without the "DRF" at the end (e.g., "DoeWorkHours20091230").

While the user can obviously save the form wherever they want, I'm not worried about restricting them, at this point, from saving it elsewhere using the file : Save As... menu.

Realizing that Infopath 2007 and Sharepoint Server might be more amenable to this process, it is unfortunately ruled out due to financial restrictions.

I'd prefer to use VBScript over JScript (assuming I have to use either) to perform this task, because I'm more use to Visual Basic .NET (we have Visual Studio 2008).  I'm really not that familiar with the Object Model, and getting a solid model to a tangible example in our situation might greatly assist in learning it.

Thanks!

Kevin
0
kmoloney
Asked:
kmoloney
  • 4
  • 2
1 Solution
 
clayfoxCommented:
This is all simple.

Best practice is to disable the save and save as and have buttons like you have outlined.

No need for code.

Go to tools and Data Connections and add a submit connection to SharePoint.  Set it up for your draft locations and use a concat function to create your naming scheme.  Then create another submit connection for the policy committe.  Then just have a rule on the first button to use the draft submit and the other to use the second.

This is all standard functionality that you do not have to over complicate.  Once you try it you will see.
0
 
kmoloneyAuthor Commented:
I think I've got you, except where do I access the concat function to assign the name of the form?

Sorry such a novice...
0
 
kmoloneyAuthor Commented:
Oh sorry, I see the function for the form name....
0
NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

 
kmoloneyAuthor Commented:
Clayfox...pretty sure you've got the answer, although I'm a little confused about another thing...

In SPS, I created two subfolders within the SPS Site where I put the main form (local DNS reference to our location:  http:\\sharepoint\QualityReview\)  - DRAFTS and SUBMIT, and followed your instructions.  I get an error saying that it cannot locate the folder.  Now, I'm just finishing up New Year's eve break, so I'll be back in the office on 1/5.  But I was curious about that:  if I create a folder within a site, does it create it as I would expect the same MD command (e.g., \\QualityReview\Drafts and \\QualityReview\Submit), with the same hierarchy, or do I have to actually create the directory differently?  I was going to try that, but then it was 5:00 p.m. on the day before my vacation.

Thanks for your help.

Kevin
0
 
clayfoxCommented:
Subfolders are a lot tougher.  It would be better to use two libraries, or just have the status as a promoted property and use filters on  the list.

Filtered views are always a better road than traditional subfolders in SP.
0
 
kmoloneyAuthor Commented:
I'm sure your solution will work, although I haven't been able to get to the solution yet.  It was clear and concise.  Thanks.
0

Featured Post

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

  • 4
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now