Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I have a document library that have a column named "Region", after some user uploads a doc to the library, I want to update this column based on this user's region property. for example, if this user's region property is "Canada", once he/she uploads the doc, the column "Region" should be marked as "Canada". So far, I can make the event firing, but I have no idea how to pass user's region value to the event handler. Please help. Thank you.

share|improve this question
add comment

2 Answers

up vote 0 down vote accepted

You do not "pass" data to an event receiver.

In your scenario, the user's region must be stored somewhere. (The most likely place is in their user profile.) You can access the user whose action caused the event to occur thru the "UserLoginName" property of the event properties. Use this value to query the profile (or some other storage medium) for the region of the user.

share|improve this answer
add comment

You can get the region information based on current user information from the properties passed into the event method: properties.OpenWeb().CurrentUser.RegionalSettings

Actually, you can get almost anything you need from properties.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.