Setting Dynamic Save Location in InfoPath Form - InfoPath Dev
in

InfoPath Dev

Setting Dynamic Save Location in InfoPath Form

Last post 05-27-2009 02:04 PM by warrtalon. 7 replies.
Page 1 of 1 (8 items)
Sort Posts: Previous Next
  • 05-27-2009 12:27 PM

    Setting Dynamic Save Location in InfoPath Form

     I have a form published to a SharePoint document library that has a WF attached to it. When someone navigates to the form and clicks "New" it opens the form, which they then would save back to the library to kick off the WF. This is all fine and good.

    The problem is that I want the form to go to a certain folder based on a field drop down they pick in the form(EmployeeName) and click Submit. I can create the folders before hand, but i need to know if Infopath uses some type of special chars in the data connection wizard. I would be looking for it to go to something like this: https://internal.company.com/docs/forms/%EmployeeName%
    where the %EmployeeName% is the variable that is grabbed when they select their name in the drop down.

  • 05-27-2009 12:37 PM In reply to

    Re: Setting Dynamic Save Location in InfoPath Form

    You can't create a data connection to a folder within a library that I know of, so you would need to write a custom web service that saves the form within a folder (and creates that folder, if preferred), or create a workflow that moves the file from the root of the library to a specific pre-existing folder based on metadata.

    The real question, though, is why you are using folders to begin with.  Can you explain the requirements so that we can ensure you need to use folders.  It's best not to use folders as that is more of an old school approach whereas you can do great things with views now that leverage metadata.  You can also use that same metadata to restrict rights within the form itself (separate from SharePoint permissions).

  • 05-27-2009 12:42 PM In reply to

    Re: Setting Dynamic Save Location in InfoPath Form

     I'm using it for expense reports. So when a user creates an expense report, and submits it, it drops into a common folder that everyone has access to. Since i can't restrict access at the parent because it will restrict users from submitting, I don't know how to make the docs secure. My thought was to have the user submit a form, it would go to their folder which i could then restrict to only managers and that user.

  • 05-27-2009 12:57 PM In reply to

    Re: Setting Dynamic Save Location in InfoPath Form

    Ok, so you would be using folders for security within a single library.  That is a valid reason for using folders, but it would also be very cumbersome, because then you'd have to break inheritance on each folder and manually configure each permissions for each person who has specific access to a given folder.  That sounds like a bit much.  Here is a possible workaround:

    - Keep all forms in one library with one set of permissions

    - Create text data elements in the form for the submitter and the submitter's manager

    - Populate the submitter field with userName() as a default value

    - Populate the manager field using the Manager attribute of the GerUserProfileByName method of the UserProfileService as a default value (this only works if the manager attribute is populated in AD and is being pulled to SharePoint via the profile import.  If not, then you will need an entire custom list made that associates each user with a manager.  If it's just one group of managers for everyone and is not specific to the users, then use a Contact list that is restricted and only lists the managers, then you can make a data connection to this list to verify whether any current user is a manager or not).

    - In your Form Options, create a rule that switches the view to an "Unauthorized Access" page within InfoPath for any user who doesn't match the Submitter or Manager

    - Change (or create anew) your default view so that it only shows forms where the current user ([Me]) is the submitter or manager (promote those fields)

    This way, people only see forms in the library where they are the submitter or manager.  And, if they get the URL to another form where they shouldn't have access, they will simply be shown a blank page (view) with some sort of message and a close button.

  • 05-27-2009 01:09 PM In reply to

    Re: Setting Dynamic Save Location in InfoPath Form

     Honestly, breaking the inheritance and setting up the security isn't a big deal, as this is a small company, and i don't mind doing that for 5 folders. With that said, is there an easy way to have those forms submit to the specific folder?

  • 05-27-2009 01:15 PM In reply to

    Re: Setting Dynamic Save Location in InfoPath Form

    So there will only be 5 separate people submitting expense reports?  That's definitely a 'small' company.  Anyway, I wrote above the two options I know of.  Whether you can consider them easy or not is up to you.  You could also create separate form libraries with separate permissions, and have the forms submit to a given library via a separate data connection based on the submitter.

  • 05-27-2009 01:58 PM In reply to

    Re: Setting Dynamic Save Location in InfoPath Form

     I guess the biggest thing is that i'm still new to SharePoint, and VERY new to InfoPath, so in most of the steps you describe, i'm not sure what you mean.

  • 05-27-2009 02:04 PM In reply to

    Re: Setting Dynamic Save Location in InfoPath Form

    Oh, then you guys probably need someone who does this for a living.  Management may think it's a simple task, but there are entire MVPs around this stuff (as you can see here on this forum), entire companies dedicated to this technology (again, as you can see here), and you are dealing with two advanced technologies working together that each have their own slew of experts around the world (SharePoint and InfoPath 2007).  Asking someone with limited experience in both to build an interactive expense report with restricted access seems a bit unreasonable.

    The things I've mentioned so far would be considered somewhat easy within the InfoPath community, though not necessarily newbie level.  That is not an insult to you, but rather a plea for understanding from whoever assigned you this task.

Page 1 of 1 (8 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.