Moving a Document to the SharePoint 2010 Records Center : Page 2

Now, in the "Content Types" section of the "Document Library Settings" page, click on "Add from existing site content types". Click on "Form" in the "Available Site Content Types" control and then click the "Add" button. Now, click "OK" and you are ready for Step 3.

The final step in configuring your Records Center is to establish a rule that lets the Records Center know where to route documents that come in that are of content type "Form". Go to the Home Page of your Records Center, click on "Site Actions" and then click on "Manage Records Center".

Funny enough, with us being on Step 3, you should click the link next to "Step 3", which reads "Create content organizer rules". On the following page, click the "Add new item" link, give your rule an intuitive name ("Route Forms" seems appropriate here), choose your content type (hint: "Form" is under "Document Content Types"), browse to your newly created document library in the "Target Location" section and click the "OK" button. You should see your new Rule.

The fourth and final step in this section is that we have to configure your Records Center "Official File" web service as a "Send To" location. Go to SharePoint Central Administration and click on the "General Application Settings" link. On the next page, click on the "Configure send to connections" under the "External Service Connections" section.

Make sure your web application is selected, then, in the "Connection Settings" section, type in a name, type in the URL to your Records Center, followed by "/_vti_bin/OfficialFile.asmx". Your screen should look similar to this:

Click the "OK" button.

Congratulations! You are now ready to create a SharePoint Designer workflow to do the heavy lifting.

Creating and Using the Workflow

Open up SharePoint Designer 2010, click the "Open Site" button, type in the URL to your site and click the "Open" button. In the navigation on the left-hand side of SharePoint Designer, click on the "Workflows" icon, then click the "List Workflow" icon at the top left of the ribbon interface. Select "Customer Discount Forms" from the drop down list.

Type in a name and description for your workflow.

Click the "OK" button. Once the workflow interface loads in, click the "Workflow Settings" icon in the "Manage" section of the ribbon interface. In the "Start Options" section, elect to allow the workflow to be manually started, as well as have the workflow automatically started when new items are created and when items are changed.

Click the "Edit Workflow" icon in the "Edit" section of the ribbon interface.

Here are the basics of our workflow, which is going to run every single time an item is created or modified in our list of Customer Discount Forms. If the Form Status is "Pending Approval", we are going to send an e-mail to the Assignee and then end the workflow. If the Form Status is "Completed", we are going to promote the form to the Records Center and then end the workflow.

Let's take care of the first condition. Click the "Condition" icon in the "Insert" section of the ribbon and choose "If current item field equals value". Click on "field" and select "Form Status". Click on "value" and type in "Pending Approval".

Now, click on the "Else-If Branch" icon in the "Insert" section of the ribbon, and repeat the steps above, but set up the condition to only apply if "Form Status = Completed". Click the "Else-If Branch" one more time to account for situations where either of the other two conditions are not met. In this case, we are merely going to end the workflow. Your workflow interface should look similar to this.

Now, let's make our workflow do something. Click on the first "Start typing or use the Insert group in the Ribbon" and then use the ribbon. Click on "Action" then "Send an Email". Click on "Action" again and then on "Stop Workflow".

Repeat the same actions for the next condition, but use the "Send Document to Repository" and "Stop Workflow" actions.

For the final condition, just add a "Stop Workflow" action. Your interface should now look like this.

All we need to do now is fill in the blanks!

Click on "these users" for the e-mail action. In the "To:" field, click the Address Book icon and select "Workflow Lookup for a User". In the lookup dialog, make the following selections:

Click the "OK" button, and enter an intuitive subject.

Next, we are going to construct the body of our e-mail. Something similar to this might be good: "A user has submitted a Customer Discount Form that requires your approval. You may review the form by clicking here: LINK TO FORM. Thank you, SharePointSupport.com".

There are 2 tricky items with that response. First, we need to somehow get a link to the form in our e-mail, and second, InfoPath Forms Services forms like to use a crazy URL. In case you have been following along from the beginning, here is a brief overview:

    * Forms Services forms use a standard ASP.NET page that serves as the form processor, which accepts the follow attributes as Query String parameters:
      * XsnLocation: this is the location of your form template (used for creating new forms)
      * XmlLocation: this is the location of the filled-out form (used for existing forms)
      * SaveLocation: this is the location where the filled-out instance of the form is going to be saved (used for new forms)
      * Source: this is the "follow-on" page where the user will be sent after the form is submitted (used for any forms)
      * DeafultItemOpen: this is how the form processor knows to open the form in the browser (used for any forms) *
    * The format of the URL is: http://BASE_SITE_URL/_layouts/FormServer.aspx?Param1=Value1&Param2=Value2
So, formulating the URL for this document is going to take two steps. Since the use of HTML code is supported in the e-mail, we will encompass everything in an anchor tag. The first step is that we need to build out our base URL, according to the standard format, and then insert the URL to our document in the XmlLocation parameter of the Query String. We do that by clicking the "Add or Change Lookup" button in the lower left of the E-Mail message dialog. The attribute you want is "Encoded Absolute URL".

Your E-mail construction dialog should look similar to this when you are done.

Please note that I also included a reference to the Current Item's "Name" attribute as the actual text displayed in the link, by including it inside the anchor tag.

Click the "OK" button.

Click the "this message" link on the next action in the workflow interface. Log the message "E-mail sent to Approver".

Now, we are going to work with the actions for the "Completed" condition. Click on "this action" for the Submit File action and choose "Move". This will move (vice copy) the item.

Next, click on "this destination router" and enter the URL to your Records Center's OfficialFile.asmx. Then, click on "this explanation" and enter something meaningful, such as "Moving approved Customer Discount Form". For the next action, log the message "Approved form moved to Records Center."

In the final action, go ahead and set it to log the message "No action required."

Your workflow interface should now look similar to this.

NOTE: For a truly "Real World" scenario, you might want to account for a form that is denied as well. Using the same workflow, you could add another condition to the "Completed" condition. If the Form was approved, do the actions we set up above. If the form was denied, send an e-mail to the originator that his form was denied and stop the workflow with a log message. No problem.

So, if we did everything right, we should be able to submit a file, get an e-mail, click the link in the e-mail, approve the form, and see it show up in the Records Center.

One thing you will notice is that you will not be able to open the form once it moves to the Records Center. This is because there are some interesting anomalies about documents that are InfoPath Forms within SharePoint.

Please check back next week, when we will show you how to deal with those anomalies and open up those InfoPath forms from the Records Center.

12
0 Comments  (click to add your comment)
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Networking Solutions

Partners

More Networking