Sharepoint Insight by Namwar Rizvi

June 21, 2009

Access Denied while changing name of a Document of Document Library

Filed under: Configuration, Guidance — namwar @ 10:48 pm
Tags: ,

It is natural to assume that if you have Modify permission on any SharePoint item/document then it means you can update any property of that document, right? Wrong! You can update any property of a document/item except Name property. This is because in SharePoint terms, changing the name of the document means two things:

  1. Creating a copy of the current document with the new name and
  2. Deleteing the current document.

If you don’t have Delete permission and just have Modify permission then you can modify every property except the Name property.

So, if you are getting Access Denied error while changing the Name of a document of a SharePoint Documnt Library and you know that you have the Update/Modify permission on that doucment then make sure you also have Delete permission on that document.

June 14, 2009

How to add custom CSS in your WebPart

Filed under: C#, Solutions, Tips — namwar @ 10:37 pm
Tags: , ,

If you want to add custom CSS file for your webpart, here is the code:

  1. protected override void CreateChildControls()
  2. {
  3. base.CreateChildControls();
  4. CssLink cssLink = new CssLink();
  5. cssLink.DefaultUrl = “/_layouts/Test.css”;
  6. this.Page.Header.Controls.Add(cssLink);
  7. }

May 30, 2009

Quickest way to copy files from GAC

Filed under: Management, Tips — namwar @ 9:18 pm
Tags: , , ,

Yes, I know how painful it is to realize that you can not copy an assembly out from Global Assembly Cache (GAC), at least not by usual way of copying a file from a windows folder. Don’t worry, there are some ways to do it and the quickest way to browse the GAC and copy files from it is to just map a drive on Windows\Assembly folder.

Here you go, 

  1. From Start-Run type cmd to launch command prompt
  2. Type subst Z: C:\windows\Assembly and press Enter
  3. Thats it!

Now, you got a drive Z which is mapped to your GAC folder and you can easily open it in Windows Explorer and copy files from it.

Isn’t it easy?

May 25, 2009

User Profile Import is not updating changes in Manager property of Active Directory

Filed under: Uncategorized — namwar @ 10:10 pm

Some of you might have experienced an issue that if you update manager  property of any user in Active Directory, it does not get reflected in SharePoint Profile Import. This issue has been identified as a bug in Profile Import and can be fixed by Installing Service Pack 1 of MOSS/WSS.

The reason behind this bug is that SharePoint Profile Import does not detect change in Manager property due to some weired reasons.

If you can not install service Pack 1 then you can fix it by implementing a workaround as follows:

  1. Open SharePoint Central Administration
  2. Navigate to your SharedService Provider e.g. SharedServices1
  3. Under User Profiles and MySites click User Profiles and Properties
  4. Under User Profile Properties , click View profile properties
  5. Click New Property
  6. Add ModifyTimeStamp property and map it to ModifyTimeStamp property of Active Directory.
  7. Click OK
  8. Perform Full Import of user profile
  9. Perform Full Crawl and you are done!

April 7, 2009

Microsoft SharePoint Designer is now Free !

Filed under: Customization, Tools — namwar @ 9:49 pm
Tags: , , , ,

SharePoint Designer Team at Microsoft has announced at its blog here that Anyone can use SharePoint Designer as a free tool. This is really a step in right direction and will help SharePoint community to build better user experiences. 

You can download the SharePoint Designer from here

April 1, 2009

How to Search on Last Modified By field in SharePoint Advanced Search

Filed under: Bugs, Search, Solutions — namwar @ 9:37 pm
Tags: , , , ,

If you are wondering why you are unable to find any search result for Last Modified By filed in Advanced Search of SharePoint then don’t worry, you are not alone. This is one of the bug which still exist in SharePoint 2007 Server Search engine. I have found a solution posted by Pritam Dhake ina  SharePoint forum. I have used this solution and it works like a charm.

Here are the steps to manually hook the Last Modified By field to the creawled field.

  1. Open Central administration -> Shared Services -> SharedServices (X being the number of the shared services provider for the site you are creating a mapping)  – > search settings -> metadata property mappings 
  2. Click “Modifiedby” to edit the properties 
  3. Make sure  “Include values from all crawled properties mapped” is selected
  4. Click “add mapping” and select the “Office” category from the dropdown list. 
  5. look for a property named “OFFICE:8” , click “OK
  6. Click “add mapping” and select the “ows_Last_x0020_Modified(text)” from the ALL categories dropdown list, Click “OK
  7. Make sure the box is checked “Allow this property to be used in scopes”, click “OK
  8. Click on “Crawled Properties” link on the left side of the Shared Services Administration page. 
  9. Click On the “Office” Category.
  10. The mapped property you just created should be listed in the “Mapped To” column of the Office:8(Text) category.
  11. Click on the Office:8(Text) category to view the properties.
  12. In the “name and information” section, you should see the “property Set ID:” value is  ‘F29F85E0-4FF9-1068-AB91-08002B27B3D9‘ …This is very important!!!
  13. In the “Mappings to managed properties” section the managed property you edited in steps 2 – 7 should be listed. 
  14. The box to “Include values for this property in the search index” should be checked.
  15. Click “OK” to exit this page.
  16. Open “Shared Services administration” -> “ShareservicesX” -> “Search Settings” -> “Content Sources and crawl schedules” 
  17. Click on “Local Office SharePoint Server sites” to expand the dropdown list and select “Start full crawl” 
  18. When the crawl has completed, navigate to the site collection -> click on the search tab. 
  19. Select “Advanced Search” 
  20. In the properties dropdown list select “Last Modified By
  21. Select contains
  22. Enter a name that you know has added / edited a document
  23. Click the magnifier to execute the search
  24. Get back results.

March 27, 2009

Solution for “Virtual PC has detected an invalid or missing Product ID” error

Filed under: Configuration, Solutions — namwar @ 11:10 pm
Tags: , , ,

If you are like me and use Virtual PC for developing SharePoint solutions, then you may have encountered the error “Virtual PC has detected an invalid or missing Product ID”.  It happens because Virtual PC try to find its product ID in registry, (Yes! I know Virtual PC never asked you to enter the Product ID during installion) and if it does not find it there then it displays this error.

virtual-pc-product-id-error

Here is the quick fix for this error:

 

  1. Open System Properties window by clicking System in Windows Control Panel
  2. You will get the screen similar to the following
  3. system-properties1

  4. Copy the 20 digit long number displayed under Registered to: 
  5. Goto Start->Run
  6. Type regedit, It will launch the registry editor
  7. Navigate to the following registry node My Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Micorosoft\Virtual PC\5.0\Registration
  8. Edit the value of PID, by double clicking it
  9. Paste the value of Windows Product ID, you have copied earlier. Following is an example screen shot of registry
  10. virtual-pc-registry

  11. Now you can run the Virtual PC normally :)

March 25, 2009

Ten Themes for SharePoint in VSeWSS Projects

Filed under: Guidance, Templates — namwar @ 9:30 am
Tags: , , , ,

Ten new SharePoint themes have been released by Microsoft to help SharePoint designers to make new sites more efficientlty. You will find them as individual  Visual Studio 2008 projects which when deployed to SharePoint offer fresh new designed themes you can use in your projects. 

Themes can be downloaded from here

Following is a preview image of these themes (from Sharepoint.microsoft.com)

March 24, 2009

Visual Studio 2008 extensions for Windows SharePoint Services 3.0, v1.3 – Mar 2009 CTP

A goow news for SharePoint community :) Microsoft has releasesd the Mar 2009 CTP of Windows SharePoint Services 3.0 v1.3. This CTP contains excellent set of functionalities and saves your precious time. You can download the extensions from here

Following is the overview as released by Microsoft

This is the SharePoint developer tools for Visual Studio 2008. These tools are suitable for use with Windows SharePoint Services 3.0 or Microsoft Office SharePoint Server 2007. It includes project and item templates for common SharePoint artifacts, it includes build, packaging and deployment for SharePoint solutions and it includes the SharePoint Solution Generator which creates a new Visual Studio 2008 project from a SharePoint site.

The tools provide item templates for List Definition, List Definition from Content Type, Content Type, Field Control, Web Part, Module, Root File, Template, Event Receiver, and List Instance. It provides project templates for Team Site Definition, Blank Site Definition, List Definition, Web Part and Empty. It works with Visual Basic .NET and C# languages and a comprehensive user guide is included. It does not include the SharePoint Workflow templates as they are built in with Visual Studio 2008.

New features in version 1.3 include:

  • Can be installed on x64 Server OS machines running SharePoint x64. Previously only x86 Server OS could be used
  • Separate build commands for package, deploy and retract are added as Visual Studio menu items
  • WSP View improvements for consistency of deleting feature elements, merging features and adding event receivers to features
  • Command line build, package and retract commands are included enabling continuous integration and build servers. Previously command line build of SharePoint projects was very difficult
  • Refactoring support for renaming of Web Parts. Previously renaming a web part required changes in several files in the project
  • Solution Generator can now generate solutions from publishing sites. Previously only regular sites could be generated
  • Allowing partial trust BIN deployments of web parts
  • New project item template for SharePoint RootFiles items
  • Deployment will now optionally remove conflicting existing features on the development server prior to redeployment. Previously any feature name conflicts would result in an error
  • Ancillary assemblies such as for business logic can now be added to the SharePoint Solution WSP
  • Hidden features related to Site Definition projects are now shown in WSP View. They are no longer hidden
  • For advanced users a fast deploy is included to update only the compiled assembly on the SharePoint development installation
  • Deployment step logging is included
  • The List Definition from Content Type template now allows for the creation of a List Definition Event Receiver
  • The User Guide is now installed with the extensions instead of being a separate download

March 15, 2009

Display filtered files list without creating new views

Filed under: Management — namwar @ 9:26 pm
Tags: ,

You may have noticed already thatwhen you try to save file in any document library from Microsoft office applications, you get a nice view of files list inside file dialog box like below:

flie-dialog2

This view is just an html generated by the owssvr.dll file located in _vti_bin folder of your virtual server. You can use this to display list of files on your web page by using Page Viewer Web Part. Say, for example, you want to display all the .doc files of Shared Documents documents library then URL will be

http://mossdev:500/Yahoo/_vti_bin/owssvr.dll?location=Shared%20Documents&dialogview=FileSave&FileDialogFilterValue=*.doc;

You will get the following display in your Page Viewer Web Part

file-properties

Following are the details of query parameters:

  1. location=document library name
  2. dialogview=FileSave (there may be other options but for the list, we will use this options)
  3. FileDialogFilterValue =specifies what type of files will be displayed in the list, feel free to specify any file filter as you normally specify in windows file dialgogue boxes. For example, for all xls files starting with a can be listed by specifying the filter value as a*.xls.



Next Page »

Blog at WordPress.com.