SharePointAds TextOnly

Wednesday, 25 August 2010

How to get approvers user name in workflow?

When you assign workflow task to any group and how would you get task approvers user name? Task list can show only 'assigned to' column which will give you group name only.
You can fetch approvers user name by creating custom List item event receiver for task list. Create Item updated event receiver and add following code...

public override void ItemUpdated(SPItemEventProperties properties)
{
base.ItemUpdated(properties);

SPListItem oListItem = properties.ListItem;
oListItem["ApprovedBy1"] = properties.UserDisplayName;
oListItem.Update();
}

*Note: Create new column for workflow task list. I created new column with ' ApprovedBy1 ' name.

Saturday, 7 August 2010

How to Edit User Profile in Sharepoint 2010?

If You have to modify user profile information from 'People and Groups' option in Sharepoint site then you can't directly edit user profile information. Even on edit user page you will see only non editable data.

User profile information can be change from 2010 central administration site. Follow the steps to modify user profile or user properties.
  1. Login Central Admin site
  2. Click on 'Application Management' option menu from left navigation
  3. In 'Service Application' section, click on 'Manage service applications' link
  4. From this serviceappliction page, click on 'User Profile Service Application' link
  5. And then you can see lots of options for people, synchronization, Organizations, My site settings etc etc,
  6. On same page, under People section click on 'Manage User Profiles' link
  7. find the user and click on User name from below grid, select 'Edit My Profile' option
  8. You can change user profile on edit form.
  9. Click on 'Save and close' button
By default it could take up to some time to reflect the new updated information througout all web applications bound to the user profile service application. A timer job is taking care of this and you could kick this one of to run manually once by going to "Check Job Status" screen in Central Admin (http:// site /_admin/Timer.aspx).