I would like to know under which account does event receiver code run?
Also suppose event receiver is ran on item added event that creates an item in another list. Then what will be the created by value foe that new item?
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It only takes a minute to sign up.
Sign up to join this communityI would like to know under which account does event receiver code run?
Also suppose event receiver is ran on item added event that creates an item in another list. Then what will be the created by value foe that new item?
The event receiver will run under the account of the user who has triggered that event, like say ItemAdding will run under the account of the user who has added the item etc. You can use
properties.CurrentUserId
to get the id of the user under whose context code will be executed.
See this blog for more details