4

http://social.technet.microsoft.com/Forums/ar/sharepoint2010programming/thread/b60495ee-29be-4aa0-935e-484abce6b9d2 explains how to approve a file using Client Object Model. Doing so, the 'modified date' and 'modified by' values gets changed (which is obvious).

But, I have a requirement to approve the File without changing those field values.

Can it be done?

If I first publish the file and then update the above-mentioned fields, then the version gets incremented, which is undesirable.

Thanks and Regards,

Arjabh

arjabh
  • 71
  • 1
  • 5

2 Answers2

1

Instead of using .update() use .systemupdate() - this bypasses modifying the date last I checked.

Anders R. Bystrup
  • 15,729
  • 10
  • 59
  • 55
Greg
  • 27
  • 2
0
ListItem item = get the item here
item["Modified"] = modifiedDate; // new modified date

FieldUserValue newModifiedBy = new FieldUserValue();
newModifiedBy.LookupId = modifiedBy; // your LookupId value
item["Editor"] = newModifiedBy;
item.Update();   
$ctx.ExecuteQuery();
san
  • 304
  • 4
  • 20