|
|
After the release of Sharepoint 2010, the request for Cascading Drop Down, filtered drop down, dependent drop down or what you call them is not so common anymore. The reason for this is of course the Managed Metadata Service, which is included in Sharepoint Server 2010.
There are still times, however, when you’d want to use the functionality below to filter your drop downs. If you for instance are running Sharepoint Foundation, not Server, you won’t have the Managed Metadata Service available at all. Or perhaps you are running server, but you want to use list data and not terms from the term store.
Read more about Cascading Drop Down in my previous post for Sharepoint 2007.
The solution
The solution below is tested with Sharepoint 2010, and is basically the same procedure as the one for 2007. The list is still standard Sharepoint, which gives great flexibility and stability. This way, the filtering is done in the forms for creating and editing elements. Because of this, you don’t even have access to the server to implement this.
1. Add the Jacascript
Download the Jquery file jquery-1.6.2.min.js by Jquery.com. Download jquery.SPServices-0.6.2.zip from the Jquery Library for Sharepoint Codeplex site (newer version is probably also OK). Upload jquery-1.6.2.min.js and jquery.SPServices-0.6.2.min.js (from the zip file) to a document library that everyone accessing your site has access to (a library on the top level site can be wise).
2. Create your relationship lists
Make two lists, one for the parent (Country) and one for the child (City):
Countries list:

Cities list:

The Country column can be a look up from the Countries list, but you can just as well use a standard single line of text column, which I have done here. This can theoretically give better performance, but you must of course be precise when filling out the County column so that the values here matches the ones in the Countries list.
3. Create the list that is actually using the Drop Down
Vacation Plans list:

This is the list where I want my Cascading Drop Downs. Country and City are lookup columns against Countries and Cities lists. The lookups goes against the title field in the respective columns.
4. Make the magic happen
In Sharepoint Designer, create your own NewForm.aspx (or EditForm.aspx, you’ll need both if you want it to work when editing items). Editing forms is a lot easier now with Designer 2010.
Just below
<asp:Content ContentPlaceHolderId="PlaceHolderMain" runat="server">
insert this code:
<script language="javascript" type="text/javascript" src="/address to document library/jquery-1.6.2.min.js"></script>
<script language="javascript" type="text/javascript" src="/address to document library/jquery.SPServices-0.0.6.min.js"></script>
<script language="javascript" type="text/javascript">
$(document).ready(function() {
$().SPServices.SPCascadeDropdowns({
relationshipList: "Cities",
relationshipListParentColumn: "Country",
relationshipListChildColumn: "Title",
parentColumn: "Country",
childColumn: "City",
debug: true
});
});
</script>
Save and create a new item using your new form:

Voila!
5.Explained:
relationshipList: “Cities” : this is the name of the relationship list = the list containing parent and child
relationshipListParentColumn: “Country” : Column name from the Cities list
relationshipListChildColumn: “Title” : Column name from the Cities list
parentColumn: “Country”: Column name from the list where the drop down is = Vacation Plans
childColumn: “City”: Column name from the list where the drop down is = Vacation Plans
You have lost of other options explained at the project site on Codeplex like sorting, multiple levels and so on.
Thanks to Marc D. Anderson for making this available.
I tested this on Sharepoint Server Enterprise 2010 with Service Pack 1 installed. It should work just as fine on Sharepoint Foundation. My installation is English Sharepoint with Norwegian Language Pack, but pure English should be jsut as fine.
I got this error in the event log on a fresh Sharepoint Server 2010 February Cumulative Update installation:
A Kerberos Error Message was received:
on logon session
Client Time:
Server Time: 17:6:26.0000 4/2/2011 Z
Error Code: 0x7 KDC_ERR_S_PRINCIPAL_UNKNOWN
Extended Error: 0xc0000035 KLIN(0)
Client Realm:
Client Name:
Server Realm: DOMAIN.LOCAL
Server Name: MSSQLSvc/sqlserver.domain.local:1433
Target Name: MSSQLSvc/sqlserver.domain.local:1433@DOMAIN.LOCAL
Error Text:
File: 9
Line: f09
Error Data is in record data.
Solution:
Continue reading →
There are tons of blog posts about using the Content Query Web Part to show for example news from an Announcement list. I myself learned a lot from this Heather Solomon post a couple of years ago.
In this post I am going to show you step by step how to create an Item Style for your CQWP that displays an announcements image, title, date and the first 250 characters of the description. This works for Sharepoint Server 2010, and unlike 2007 you don’t have to export the CQWP and change the code – no notepad this time!
1. For best practise, I created my own Content Type inheriting from the Announcement Content Type. Lets call this CompanyAnnoucement. To CompanyAnnoucement I added an existing site colum: Rollup Image. Add CompanyAnnoucement to the list(s) you want. If lots of people needs direction on this step, I’ll make a blog post about it.
Continue reading →
I was installing the latest Cumultative Updates (December 2010 version) on a small Sharepoint Server 2010 farm. I installed both the Foundation and Server hotfix package on the application server and then the web front end.
Next step was running the Sharepoint 2010 Products Configuration Wizard on the application server. The wizard started out just fine, but I only got to step 9 (“The farm is being upgraded in the timer service process. The task is 10.00% completed.”) where it subsequently failed (Configuration failed). The error message was:
“An exception of type Microsoft.SharePoint.PostSetupConfiguration.PostSetupConfigurationTaskException was thrown. Additional exception information: Failed to upgrade SharePoint Products.”
Reading in the logs revealed what seemed to be why the upgrade failed, but no hint on how to fix it:
“01/04/2011 15:27:39 14 INF Resource id to be retrieved is UpgradeTaskFailConfigSyncDisplayLabel for language English (United States)
01/04/2011 15:27:39 14 INF Resource retrieved id UpgradeTaskFailConfigSyncDisplayLabel is Failed to upgrade SharePoint Products.
01/04/2011 15:27:39 14 INF Leaving function StringResourceManager.GetResourceString
01/04/2011 15:27:39 14 INF Entering function Common.BuildExceptionMessage
01/04/2011 15:27:39 14 INF Entering function StringResourceManager.GetResourceString
01/04/2011 15:27:39 14 INF Resource id to be retrieved is ExceptionInfo for language English (United States)
01/04/2011 15:27:39 14 INF Resource retrieved id ExceptionInfo is An exception of type {0} was thrown. Additional exception information: {1}”
When I ran the Configuration Wizard again on the application server, it succeded, but I suspected the upgrade was not completed. I subsequently ran the Wizard on the WFE also, where the upgrade succeded. In Central Administration, I now had one “Succeded” Upgrade Session on the WFE and one “Failed” Upgrade Session” for the application server on the Upgrade Status Page in Central Administration.
Restarting the servers or running the Configuration Wizard either via different psconfig variations or UI did not give me a successful upgrade session for the application server.
The next day I also got a warning in the Health Analyzer:
“Product / patch installation or server upgrade required.
All required products must be installed on all servers in the farm, and all products should have the same patching and upgrade level across the farm.
Upgrade is required on server APPSERVER. Without the upgrade, the server is not in a supported state.”
Obviously not a perfect situation. The solution which solved the problem and completed the upgrade was also mentioned. Here is the Powershell command that did the trick for me:
PSConfig.exe -cmd upgrade -inplace b2b -force -cmd applicationcontent -install -cmd installfeatures
The December 2010 Cumulative Updates for Sharepoint Foundation and Sharepoint Server 2010 has been released. They seem to contain quite a few fixes, especially for the User Profile Service which from what I read will synchronize faster (It might actually look like this is the case, I think User Profile Synchronization was somewhat faster now). For some reason they are not published on the official Sharepoint Update page, which is why I am writing this post.
I have installed the updates in a 2-server farm, everything seems to work fine afterwards.
Unlike after the October Updates, I didn’t have to re-provision the User Profile Synchronization Service afterwards, as this service was listed as started when I had finished upgrading. (If re-starting/re-provisioning this service, remember to add the Farm Account to Local Administrators and reboot before starting the service).
I have linked to the downloads on my download page.
Version number after updating should be 14.0.0.5130.
Update: The December 2010 Updates are as of 07.01.2011 now available via the Sharepoint 2010 Update Resource Center.
The October 2010 Cumulative Update for Sharepoint Server 2010 brings an interesting update. Finally, you can now not only export profile pictures to Active Directory, but you can also import pictures from AD to Sharepoint without much hassle. Check my resources page for a link to the downloads. Quote from the kb:
“Consider the following scenario. You try to import pictures in a user profile from the Active Directory thumbnailPhoto attribute to the PictureURL attribute in Microsoft SharePoint Server 2010. You set up an import PictureURL mapping. Then, you perform a full synchronization in the SharePoint server. In this scenario, the pictures are not added to the user profile in the SharePoint server.
Note You can use following command to perform the import operation:
Update-SPProfilePhotoStore -CreateThumbnailsForImportedPhotos 1 -MySiteHostLocation http://<YourServerName>/my”
Update: Microsoft has removed this update for the time being. Anyway, I downloaded it while it was available, and it does work. You have to run the Powershell command after syncing for the images to appear on My Site etc. I guess it will be available again when Microsoft has fixed whatever was the problem. This update has been re-released, and is available for download again.
A note here is that if you delete the picture from AD the thumbnail will not be deleted from Sharepoing even after running the Powershell command.
A second note is that the user running this Powershell command must have permissions on the User Profile Service Application, if not you’ll get an error message.
You might have noticed the Memberships tab on a user’s My Site (http://mysite/_layouts/MyMemerships.aspx?accountname=domain%5Cusername), and wondered what exactly is listed there:

What you see is Distribution Lists that the user is member of. You also see Sharepoint Sites that the user is a member of (=the user is member of the “Member” group for the site. All sites on the levels below will also show if the “Member” group exists in these sites).
The “Sites” memberships depends on Search. If you cannot see any sites memberships, try running a full crawl.
The Distribution Lists memberships depends on the User Profile and User Profile Synchronization. A common issue can be that you import user profiles from a selected OU in AD as per best practise. If, however, your groups are placed in another OU at the same level or levels above, Sharepoint will not now about these membership. So, if you can’t see any Distribution Lists on the Memberships page, change the Synchronization Connection for the User Profile Service Application to include the OU where you have your groups and run an import.
You might also notice that Security Group Memberships are not shown. They are, however, displayed in the Newsfeed:

So,
you create a sandboxed solution in in Visual Studio 2010 for Sharepoint 2010, and you use a feature receiver to handle upgrades. You add a CustomUpgradeAction to your feature.xml file to fire some code when feature is upgraded.
You forget that you cannot simply write to the event log or the Sharepoint (ULS) logs in a sandboxed solution, and add some code like this:
SPSecurity.RunWithElevatedPrivileges(delegate()
{
System.Diagnostics.EventLog.WriteEntry("My Company, solution x", ex.Message);
});
in the FeatureUpgrade method to write something to the event log, maybe to check what went wrong if you have some errors in your code.
You will see that the FeatureUpgrade method is not firing when upgrading. You won’t get any errors either, and attaching to the SPUCWorkerProcess.exe for debugging won’t help either – nothing happens.
To make things work, you have to remove the statement writing to the log, this prevents the event receiver to function properly.
P.S. If you add a statement like the one above to the FeatureActivated method, you will at least get an error message so you know what’s happening.
I had set up a small Sharepoint 2010 farm, DB server, App server and WFE. The User Profile Service Application was running, and profile synchronization worked fine. However, I also wanted to export some properties back to AD, in this case the users Picture.
I mapped the Picture field to the AD attribute thumbnailPhoto, set the direction to export and started a Full Synchronization. (This blog post provides excellent information)
Nothing happended. (Well, the sync went just fine, but the Picture field was not populated. The problem was I couldn’t see any errors either, the export was not just happening. First I assumed this was a permissions issue, but then I should’ve seen errors in the logs, and granting permissions de luxe for the sync account didn’t help either. I opened miisclient.exe (no errors here neither), and when viewing a user profile that had set the Picture field, FIM still reported “Initial value” as empty. So I took a look in the Sync DB and viewed the “dbo.mms_metaverse”-table. Here I had a column “SPS_MV_OctetString_PictureURL”, but this was also empty for all users. Hmmm. Strange, the picture was in Sharepoint, I could see it with my own eyes, but it just wasn’t syncing.
Solution:
In the C:\Program Files\Microsoft Office Servers\14.0\Synchronization Service\Bin\miiserver.exe.config file, add the following lines:
<system.net>
<defaultProxy>
<proxy usesystemdefault = “false” proxyaddress=”http://proxy.dummy.com:8080″ bypassonlocal=”true” />
</defaultProxy>
</system.net>
Then I restarted the server (the FIM services would probably have been enough), ran a full sync and the pictures was being exported. Somehow a rule on this network caused FIM not to get the changes from the User Profile Service Application (strange though, that import including custom fields and mapping worked fine). Anyways, inserting this dummy proxy made it work.
Update: The cause of this issue was that the “User Profile Service” under “Services on Server” was running on both application server and web front end. I re-did everything, and before creating the User Profile Service Application I stopped the “User Profile Service” on the Front End. I also created a new application pool just for the User Profile Service (running under the Farm Account) when creating the User Profile Service Application. Now I had no problems removing the Farm Account from local administrators prior to running a succcessful sync.
So, if you want the User Profile Service Application to run only on your app server, make sure the User Profile Service is only running on the app server. Also, by creating the application pool and using it only for this purpose, I made sure that this application pool was only created on the app server.
The User Profile Service in Sharepoint 2010 provides some excellent functionality, but to sum up how it is to install and configure: slow and shitty (pardon my French).
I set up a small farm (Windows Server 2008 R2, 1 SQL, 1 Application Server, 1 Front End) and set up the User Profile Service Application according to “best practise” which includes removing the Farm Account from Local Administrators after setting it up. Everything works like a charm – until I reboot the machine. Then I get this error in the Event Log after each reboot (or restarting the ForeFront Identity Manager Service). When starting a User Profile Synchronization from Central Admin (Full or Incremental), nothing happens – Profile Synchronization Status is just idle. The services both in Central Admin and services on server are running just fine. All I can see are this, this, this, this, this and this error in the Event Log on the App server, and this error on the Front End.
I had of course read this and this post till my eyes were sore.
Solution: Finally, I added the Farm Account back as Local Admin both on App Server and Front End, rebooted and everything works. Far from ideal, but when I seem to be having a functional User Profile Service Application, from now on I won’t touch it…:)
Continue reading →
|
|