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.
Tell me more
×
SharePoint Stack Exchange is a question and answer site for
SharePoint enthusiasts. It's 100% free, no registration required.
|
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. |
|||
|
|
|
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. |
|||
|
|