0

can you please tell me, how to retrieve the user who make the change on the ChangeItem object please.

below the code used :

var col = oList.GetChanges(cq);
clientContext.Load(col);
clientContext.ExecuteQuery();

foreach (Change change in col)
{

if (change is ChangeItem)
{
ChangeItem ci = change as ChangeItem;
ChangeType changeType = ci.ChangeType;
string itemId = ci.ItemId.ToString();

//RETRIEVE THE USER WHO MAKE THE CHANGE

// .................

}

}
0

Try the below code:

var col = oList.GetChanges(cq);
clientContext.Load(col);
clientContext.ExecuteQuery();

foreach (Change change in col)
{

    List list = clientContext.Web.Lists.GetByTitle("CustomList");  //change as per list name
    if (change is ChangeItem)
    {
        ChangeItem ci = change as ChangeItem;
        ChangeType changeType = ci.ChangeType;
        string itemId = ci.ItemId.ToString();

        var modifiedBy = ci.Editor;
        var modifiedLoginName = ci.EditorLoginName;                                        

    }
}
| improve this answer | |
  • Hello Gautam and thank you for your help. I have a question. for example, if i have an event "Change" on the same item but different user, your code will retrieve always the last person who edited the item. no ? – souf Feb 16 '17 at 15:52
  • Glad I could help, could you please mark it as answer if it resolved your problem ? :) – Gautam Sheth Feb 16 '17 at 15:54
  • Hello Gautam and thank you for your help. I have a question. for example, if i have an event "Change" on the same item but different user, your code will retrieve always the last person who edited the item. no ? – souf Feb 16 '17 at 15:56
  • My bad, sorry, can you check edited code ? – Gautam Sheth Feb 16 '17 at 16:09
  • 1
    Those properties came with the newest CSOM, seems that they are not yet supported even by SP online... I have the same situation here – michalh May 21 '17 at 18:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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