25 November 2009

Sending Email from SharePoint Designer Workflow to a SharePoint Group

I hate early morning adventure. I came to office and start working on a relatively trivial task:

“Create a workflow in SharePoint designer to send an Email to a certain SharePoint Group when certain things happen.”

Looks innocent..so I used out-of-box “Send Email” activity to create the Email and put the Group Name in the “To” field, ran the workflow and…..it did not send the mail. When I check the status of the workflow instead of “Completed” it said “Stopped”. Now it didn’t through any exception but just stopped. I make sure that there is no permission issue I reran the workflow as site collection administrator and…it ran successfully. Looks like a permission issue, but permission on what??

User who is created the item already has permission on the item and list, so what’s going on. After scratching my head for few minutes it occurred to me that “Send Email” activity might not have access to the SharePoint group. I went to settings page of the SharePoint Group and under “Group Settings” check “Who can view the membership of the group?” to “Everyone”:

image

This should allow you to send the mail to this group.

Installing SharePoint 2010 beta

Yesterday I woke up with this strange urge to setup development box for SharePoint 2010 beta. Now this might sound an easy task but it was quit daunting as I was running Vista Ultimate (32-bit). I double checked my hardware and strangely found that it supports  64-bit operating system. This is great as SharePoint 2010 exclusively runs on 64-bit Vista, Windows 7 or Windows Server 2008. For reality check, I went through couple of posts and articles:

1) http://msdn.microsoft.com/en-us/library/ee554869(office.14).aspx and http://www.codeproject.com/KB/sharepoint/SharePoint_Server_2010.aspx : This is probably best available guide to install SharePoint 2010. I followed all the steps faithfully and able to get through my installation. These posts will guide you  through your installation smooth except couple of things:

i) When making changes to config.xml file that SharePoint installer uses copy this:

<Configuration>
<Package Id="sts">
<Setting Id="LAUNCHEDFROMSETUPSTS" Value="Yes"/>
</Package>

<Package Id="spswfe">
<Setting Id="SETUPCALLED" Value="1"/>
<Setting Id="OFFICESERVERPREMIUM" Value="1" />
</Package>

<Logging Type="verbose" Path="%temp%" Template="SharePoint Server Setup(*).log"/>
<PIDKEY Value="PKXTJ-DCM9D-6MM3V-G86P8-MJ8CY" />
<Setting Id="SERVERROLE" Value="SINGLESERVER"/>
<Setting Id="USINGUIINSTALLMODE" Value="1"/>
<Setting Id="SETUPTYPE" Value="CLEAN_INSTALL"/>
<Setting Id="SETUP_REBOOT" Value="Never"/>
<Setting Id="AllowWindowsClientInstall" Value="True" />
</Configuration>





ii) Posts mention a script that you can run to set IIS features that needs to be activated in order for installation to run. You might want to copy this from here:



start /w pkgmgr /iu:IIS-WebServerRole;IIS-WebServer;IIS-CommonHttpFeatures;
IIS-StaticContent;IIS-DefaultDocument;IIS-DirectoryBrowsing;IIS-HttpErrors;
IIS-ApplicationDevelopment;IIS-ASPNET;IIS-NetFxExtensibility;
IIS-ISAPIExtensions;IIS-ISAPIFilter;IIS-HealthAndDiagnostics;
IIS-HttpLogging;IIS-LoggingLibraries;IIS-RequestMonitor;IIS-HttpTracing;IIS-CustomLogging;
IIS-Security;IIS-BasicAuthentication;IIS-WindowsAuthentication;IIS-DigestAuthentication;
IIS-RequestFiltering;IIS-Performance;IIS-HttpCompressionStatic;IIS-HttpCompressionDynamic;
IIS-WebServerManagementTools;IIS-ManagementConsole;IIS-IIS6ManagementCompatibility;
IIS-Metabase;IIS-WMICompatibility;WAS-WindowsActivationService;WAS-ProcessModel;
WAS-NetFxEnvironment;WAS-ConfigurationAPI;WCF-HTTP-Activation;
WCF-NonHTTP-Activation



2) http://blogs.msdn.com/opal/archive/2009/11/16/installation-notice-for-sharepoint-2010-public-beta.aspx : This link provides the pre-installation software list and product keys. I did not follow this walks you through “Farm ” install and I targeted a “Standalone” install. So what exactly “Standalone” install does for us, I like to compare it with SharePoint 2007 install without Active Directory integration. It uses SQL Server Express as the database and should only be used for development environment.



Actual Hardware: My box is running a Intel core 2 duo (2.2 GHz) with 2GB DDR2 dual channel PC2-6400 800 MHz RAM. Install went quit smooth on this machine except when I try to spin SharePoint worker processes. My memory is not quit enough here is my memory graph:



MemoryUsage



I ran perfmon and added “Page Fault” as parameter and it clearly shows me why Microsoft recommends minimum of 4GB RAM:



PageFault2



Most of the time if you try to do a simple operation like add an item to list you will end up with an error. I have upgraded the system with 4GB extra RAM and now I am running 6GB and system is performing quit well.



 Current Issues:



Once I installed my SharePoint 2010, I got this error at the end of the install: Failed to create sample data



SharePoint Wizard Error



This is not a critical error, everything runs file except no sample data to play with. More information here: http://www.gilham.org/Blog/Lists/Posts/Post.aspx?ID=720#Comments



At  this moment this issue actively discussed here: http://social.msdn.microsoft.com/Forums/en-US/sharepoint2010general/thread/f239de4a-488e-47e1-8f1e-b382fd4668fa



Other issue that I ran into is with DataSheet Views. When I try to open my list in datasheetview it gives me this error:



DataSheetViewError



I have to research this issue more.



 



Here is the list of software installed on my development Box:



1) OS – Windows 7 (64-bit)



2) Visual Studio 2010 beta



3) Office 2010 beta



4) SQL Server 2008 beta



5) Microsoft Sync Framework



6) Microsoft identity Framework (Geneva)



7) SharePoint Designer 2010 beta (64-bit)



8) InfoPath 2010 beta (64-bit)



9) PowerPivot beta ( previously Gemini, you can download it here http://www.powerpivot.com/download.aspx )



Resources:



http://www.google.com/reader/shared/sumit.rawat


http://blogs.technet.com/gurmeets/default.aspx

20 November 2009

Quick note on case-insensitive comparison in InfoPath

I am trying to compare current user who is trying to use a InfoPath form with a field which determines his access level on the form. I ran into a issue where sometimes user will complain that they are not able to see elements even though they have permissions on it. When I dug deeper into the issue I found that some time username() function that I am using to get the current logged in user returns string in mixed case (I guess cases are determined at the source  i.e. SSP). So I am fixing this issue with by using translate() function. Here is the code snippet that I am using:

 



translate(my:CurrentUser,"ABCDEFGHIJKLMNOPQRSTUVWXYZ","abcdefghijklmnopqrstuvwxyz") 



!=translate(xdUser:get-UserName(),"ABCDEFGHIJKLMNOPQRSTUVWXYZ","abcdefghijklmnopqrstuvwxyz")




Thanks to Andrew Richter for this nice post!!