Sunday, February 5, 2012

Manage User Properties Change Display Order buttons are not working

Manage User Properties Page enables the User Profiles Service Application administrator to manage the user profile properties. He can ِِِAdd, Edit, Map, or Change the Display Order of the properties in My Profile Page.
Figure (1) Manage User Profile Service Application Page

One of the problems which I faced with Change Display Order buttons shown in Figure (2), that when I press on Move Up or Move Down buttons that it has no effect on the order and the order stay as it is.


Figure (2) Manage User Properties Page
 
After investigation and diagnosing the problem, I exported the list of the properties using the following PowerShell Script:

Add-Type -Path "c:\program files\common files\microsoft shared\web server extensions\14\isapi\microsoft.office.server.dll"
$site = Get-SPSite http://intranet.contoso.com:80/my/
$context = Get-SPServiceContext $site
$upConfigManager = New-Object Microsoft.Office.Server.UserProfiles.UserProfileConfigManager($context)
$profilePropertyManager = $upConfigManager.get_ProfilePropertyManager()
$pspm = $upConfigManager.GetProperties()
$pspm | Export-CSV c:\productionProp.csv
$site.Dispose() 

The result of executing the script shown in Figure (3).

Figure(3)  Export user properties result 

I found that some properties have the same Display Order Index value. So, I thought that this could be the reason. So, I wrote another PowerShell script to reset the Display Order index value for all the properties starting from 0 until the last property index. The following is the PowerShell Script which I used to reset the index:

Add-Type -Path "c:\program files\common files\microsoft shared\web server extensions\14\isapi\microsoft.office.server.dll"
$site = Get-SPSite http://intranet.contoso.com:80/my/
$context = Get-SPServiceContext $site
$upConfigManager = New-Object Microsoft.Office.Server.UserProfiles.UserProfileConfigManager($context)
$profilePropertyManager = $upConfigManager.get_ProfilePropertyManager()
$pspm = $upConfigManager.GetProperties()

$index = 0
$pspm.GetEnumerator() | ForEach-Object {
    $pspm.SetDisplayOrderByPropertyName($_.Name , $index)
    $pspm.CommitDisplayOrder()

    $index = $index +1
}
$site.Dispose()

After executing the script I tested the buttons to change the order of the properties and it works perfect again.

Note: This script resets the order of the properties, and it does not include the sections.

If you have any comments or questions, please don’t hesitate to post your comment.





Monday, November 28, 2011

Query Join between related lists in SharePoint 2010 using "SPQuery.Joins" property

One of the famous complains of the developers who switched from SQL background (For example Me :-)) to SharePoint development; is how to query related lists with joins instead on looping and filtering both of them using different queries.
You can Achieve this using the SPQuery.Joins Property.
Example:

  
    
      
      
    
  

  
    
      
      
    
  


Source: http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spquery.joins%28v=office.14%29.aspx

Thursday, October 6, 2011

PDF Documents Collaboration with SharePoint 2010

SharePoint 2007/ 2010 mainly used for documents management and collocation; including all the features (Check In, Check Out, Version History, etc...)  using Microsoft Office Suite. By default SharePoint does not support these features for PDF files. Adobe has released a product called Adobe Acrobat X which you can use it to achieve a good integration with SharePoint and use all its features Check In, Check Out, and Collect Feed back workflows. The following screenshots show some of its features [1].
  
Figure (1)  Open and Check out file


Refrences:

Thursday, March 17, 2011

"Insert Related List" feature in SharePoint 2010


 One of the helpful features in SharePoint 2010 is the "Related List" button.


Figure(1)

This button is used to add lists which are related to a specific list (one-to-many relationship) in the same page and filter the data according to the selected item in the primary list.
Example: In this example I’ll present a demo for Customers and Customer Orders, and how to relate the data and display it in one page.
1- Create the following two lists:
    • Customers:
    Figure(2) Customers List
    • Customer Orders:
    Figure(3)  Customer Orders
    Where the Customer field is a lookup from Customers list.

    2- Enter some data to both lists.
      3- Browse to a SharePoint page and add Customers List web part to it.


      Figure(4)
      4- In the Page Edit Mode; Activate the Customers web part by Selecting it.

      Figure(5)
      5- Clicking on “Insert Related List” shows all the lists which are related to the Customers list.
      6- Select Customer Orders.
      7- Now you will see that a new column “Select” has been added to the Customers web part and when the user clicks on it, it filters the list of orders by the selected customer.

      Figure(6)

      I hope this was useful for you.
      If you have any comments don't hesitate to post it.
       

      Sunday, February 20, 2011

      Create Site Action (SharePoint Designer 2010 Workflow Actions)

      The actions can be downloaded here.

      Add the “Create a Site” action to a SharePoint 2010 Designer Workflow

      image

      Configuration

      image
      URL: The url of the web site. You could either use an relative url to create the site direct under the current site or an absolute url to create the site under any site. The workflow initiator needs appropriate permissions. Or you can use an impersonation step to run the action under the permissions of the workflow author.
      Title: Title of the site
      Description: Description of the site
      Template: Template name of the new site. Default is Team Site (STS#0).
      You can get a list of all farm templates with the PowerShell command “Get-SPWebTemplates”.
      To get a list of templates from a specific site’s template catalog use the following PowerShell command:
      Get-SPWeb http://contoso/sites/spd | %{$_.GetAvailableWebTemplates($_.Language)}
      image
      Use the name of the template e.g. WIKI#0
      Language Code: The language code for the new site e.g. 1033 for English or 1031 for German. 0 means inherit the language from the parent site.
      Inherit Permission: Inherit permissions from the parent site.
      Inherit Top Navigation: Use the same top navigation as the parent site.
      Output: Returns the absolute url of the new site
      image

      Publish an run the workflow…


      Source http://cglessner.blogspot.com/2011/02/create-site-action-sharepoint-designer.html

      Saturday, February 5, 2011