Thursday, July 30, 2009

Setting a Person or Group Column in SharePoint Designer Workflow

Supposedly, you should be able to set a person or group column in SharePoint as long as the cumulative updates have been applied after December of last year (the December one apparently broke it lol). In our current setup, we still aren't able to set a person or group column using a workflow. I found this here at a MSDN blog archive and it basically helps you fix this problem in your workflow.

1. In your workflow, create a new variable whose type is a "String" and call it UserID
2. Use the action "Set Workflow Variable" and set it to whichever person or group column you are using
3. Use the action "Build a Dynamic String" and use a lookup to add the "Workflow Data" -> "UserID" to the string.
4. In front of the UserID lookup, add this: -1;#
5. Use the action to either "Set a Field in the Current Item" or "Update List Item" and, when setting the person or group column, use the "Workflow Lookup"->"UserID" instead of setting them directly.

Hope that helps someone, it certainly fixed our problems.

Filtering by a group in a SharePoint Person or Group column

I recently stumbled across this in a technet site here and modified it for my own use and to help anyone who wants it. I was trying to put multiple people in a SharePoint group, use a person or group column to categorize an item to that group, and then have it automatically filter based on which group you are in when you look at the item. I found the solution but it requires you to create the view that filters the Person or Group column to [Me] but then open the view in SharePoint designer and copy-and-paste the following (I know, it's scary) code. This means that you CANNOT add anything else to that view or attempt to modify it in any way after you change the code in SharePoint Designer because it will break that view and you have to do this all over again. This isn't a great solution because of that limitation but it will do if you absolutely HAVE to do this. Here are the steps:

1. Create the STANDARD view and filter to [Me] on the Person or Group column that contains the sharepoint group in which a person exists.
2. Open this view in SharePoint Designer…if it ever says you do not have permission to do something, simply click ‘Cancel’ and everything will be fine.
3. Click on the CODE or the SPLIT view near the bottom left...you want to be able to see the code itself.
4. If you are using SP 2010, skip to step 5. Look in the code for the phrase ‘ListViewXml=’ tag and then scroll a LONG ways toward the right (after all the ‘FieldRef Name=blahblah_x0020_blahblah’) and look for ‘<Where’ and it ends a little ways after that with ‘/Where>’
5. Look at the ‘FieldRef Name=’ and note what it is for this filter.
6. For 2007 users, replace the <Where thru the /Where> with the following:
<Where><Or><Membership Type="CurrentUserGroups"><FieldRef Name="REPLACEME"/></Membership><Eq><FieldRef Name="REPLACEME"/><Value Type="Integer"><UserID Type="Integer"/></Value></Eq></Or></Where>
(NOTE: DON’T MESS WITH ANY OTHER > and < in this!!)

For 2010 users, the split view in SharePoint designer will show you the encoded versions of these statements inside the <View> tag (it's SOOO pretty compared to all this garbage), so, you will want to fix them by copying and pasting this instead:
<Where><Or><Membership Type="CurrentUserGroups"><FieldRef Name="REPLACEME"/></Membership><Eq><FieldRef Name="REPLACEME"/><Value Type="Integer"><UserID Type="Integer"/></Value></Eq></Or></Where>

7. NOTE: TO USE CALENDAR VIEWS – For 2007 users, look inside the &lt;Where&gt; statement to find /DateRangesOverlap and then it has a couple of &gt’s and &lt’s and then it says EQ followed by the FieldRef Name of the key column you are using. Replace &lt;EQ through /EQ&gt; with the following:
&lt;Or&gt;&lt;Membership Type="CurrentUserGroups"&gt;&lt;FieldRef Name="REPLACEME"/&gt;&lt;/Membership&gt;&lt;Eq&gt;&lt;FieldRef Name="REPLACEME"/&gt;&lt;Value Type="Integer"&gt;&lt;UserID Type="Integer"/&gt;&lt;/Value&gt;&lt;/Eq&gt;&lt;/Or&gt;

Again, for 2010 users, it should look all HTMLified and pretty so you will want to copy and paste this instead:
<Or><Membership Type="CurrentUserGroups"><FieldRef Name="REPLACEME"/></Membership><Eq><FieldRef Name="REPLACEME"/><Value Type="Integer"><UserID Type="Integer"/></Value></Eq></Or>

8. Replace the REPLACEME’s with the fieldref name that it originally said. For instance, on one form with the Ministry teams the field name was Singing_x0020_Team (the _x0020_ is a space in the field name…and the fieldref name is the name the column was given originally…doesn’t matter if you change it after that, the fieldref name remains).

There ya go. Use only in emergencies ^_^.

Monday, July 13, 2009

Simple InfoPath 2007 Tutorial

This is the start of a series of tutorials regarding the creation of InfoPath electronic forms. For the sake of simplicity and expandability in SharePoint, I will be limiting the form to a browser-based form (so that the form can be filled out using a browser like Firefox or Internet Explorer but this requires that you are running the Enterprise version of SharePoint and not the free version). Note some of the following limitations of using a browser-based form in SharePoint:
[EDIT: I've revised this information slightly on 2/25/2011 to better fit what I have learned over the past year...so if you read this before, it will have changed]

1. Performance - Browser forms means that another computer than your own must handle anything complex or difficult to calculate...this can result in a slower form than you might like. If you aren't using browser forms, then the form will open in InfoPath 2007 on your users' computer (if installed).
2. Security - You will want SharePoint to be running in an secure environment. How do you know if it's running in a secure environment? One way (but it's not always THE way) is to look at the very beginning of the web address for sharepoint in your company. If it starts with HTTPS instead of HTTP then you are good.  If it is not, InfoPath transmits data as clear text in an xml file and thus can be intercepted. YOU are responsible for the security of the information in this form.
3. Difficulties with large lists - you will not want to use your form to connect and pull from a large list or library in SharePoint (or one that will be large any time soon...large being 4000+ items). In 2010, we will have the ability to just ask for specific information from SharePoint so this won't be a problem.
4. You must be willing to think and think logically to make a secure, fast form.

REQUIRED MATERIALS:
InfoPath 2007 and a well-rested mind.
Recommended: A SharePoint site in which you can create a Form Library (if you use a default configuration of SharePoint, you will probably need Full Control of a site or have the Site Owner create a Form Library for you to use and give you Full Control of it).

You can click below to go to the first step - planning out your form, menus, and layout tables - or use the links farther below for more information about InfoPath.


To get more information directly about InfoPath:
http://www.bizsupportonline.net/ - Site with topical tutorials on InfoPath 2003, 2007, and browser forms - includes code stuff
http://blogs.msdn.com/infopath/ - the blog of the team who actually design InfoPath
http://office.microsoft.com/en-us/infopath/FX100647031033.aspx - Microsoft's 'InfoPath: Help and How-To' site that usually has a bunch of quick articles and facts to help

Thursday, July 9, 2009

MiniDVD in Macbook Pro

Though you may not notice, the slot-loader in a Macbook Pro is rather small and doesn't open like a regular cd drive. This thing is similar to the wii except for one strong difference: the wii can handle smaller (gamecube) discs...the Macbook Pro cannot.

After attempting to use many manners of credit cards and paper, the idea was given in a forum to use a business card with double-sided tape on it to remove the miniDVD from the drive. I grabbed my trusty Blockbuster card, took regular tape and looked into a circle, mashed it into the corner of the card, slid the card in, angled it slightly, and pulled out my miniDVD. Thank God for forums!

Thursday, July 2, 2009

Will InfoPath help me?

So,
You've heard about SharePoint or WSS and that it can revolutionize your paperwork with electronic forms through InfoPath. You're probably wondering whether or not this InfoPath is the way to revolutionize your office. Here are some things to consider when it comes to using InfoPath:

1. Do you have WSS or do you have MOSS (Microsoft Office SharePoint Server)? MOSS Enterprise 2007 (or Forms Server 2007 and prior) includes Forms Services, which handles server-side rendering of InfoPath forms (what does that mean? It means that the form can be filled out online using Internet Explorer or Firefox instead of needing InfoPath)

2. If you decide to go the non-browser route, everyone who fills out the form needs to have InfoPath and access to both the form itself and wherever you want the form to send the data. If you go the browser-form route, you'll have to learn how to place it in SharePoint or see how that process works in your work environment

3. If you want the form filled out by the browser, know that there are several limitations:
  • You can connect browser forms to databases and SharePoint but cannot, without programming, filter what you get from them. For instance, you can pull an entire column of information but not a certain portion of it (so, if you have 100,000 items in the column then it pulls them all)
  • You can't use several controls that are normally available in InfoPath
  • You can't have error message windows appear on the screen
  • Using a lot of special conditions and special formatting in browser forms can slow performance
  • If you do end up having to use programming, you have to get the uppity ups of SharePoint involved at your work
4. There is a learning curve to figuring out InfoPath, though not as in-depth as Microsoft Access or Adobe Designer forms. In our line of work, we get most people developing great, advanced, codeless forms with appx 6-10 hours of training (though advanced forms may take several weeks to develop well)

5. InfoPath does allow for using signature pads to capture the signature and place it as a JPG on the form. Unfortunately, this will work only as long as you aren't using browser forms (because it's usually an Active X control that accomplishes this). You might be able to accomplish this otherwise but not that I could find. Digital Signatures are difficult to apply as well in browser forms but are supported in regular forms.

6. Apart from these considerations, are you using a lot of paper? Do you have a secure place to store electronic forms? Dear Lord, InfoPath can help you (so could Word forms, Adobe forms, or even Access, but they all have different pros/cons). InfoPath was made to help transform the business processes of many current situations. If you combine InfoPath with SharePoint and possibly SharePoint Workflows, you can have a truly powerful business process system to handle most forms of paperwork like vacation/absence forms, applications, quizzes, and more.

Wednesday, July 1, 2009

Why am I here?

I have been working lately with WSS3.0/MOSS 2007 (SharePoint 2007) and InfoPath 2007 to accomplish business processes. Everywhere I turn, I run into a roadblock and the only solutions seem to be programming-oriented. I may not be a genius but I realize neither I nor many of my colleagues have the skill or access to fix these problems (like filtering a data connection in a browser-based infopath form).

I am creating this blog to help vent some of that frustration and to provide training and tutorials for those interested in learning different Office products and what they can do without special programming/code. If you happen to stumble upon this site in its infancy, please let me know of problems you have encountered that you wish would be answered without using (or using the bare minimum of) CSS, HTML, VBA, etc.