Showing posts with label SharePoint 2010. Show all posts
Showing posts with label SharePoint 2010. Show all posts

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

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

Wednesday, January 26, 2011

Monday, January 24, 2011

Multilingual user interface overview (SharePoint Server 2010)

Dears,
I found the following article from MSDN which explains
  • Use and benefits of the multilingual user interface

  • How the multilingual user interface works

  • What is supported by the multilingual user interface

  • Adding and modifying application content

  • Exporting and importing translated content

  • Using the multilingual user interface with managed metadata

  • Limitations of the multilingual user interface 

http://technet.microsoft.com/en-us/library/ff805062.aspx#Section2