الإجابة How to update value of "CheckinComment" field using WebServices?

  • יום שני 02 אפריל 2012 17:05
     
     

    Hello,

    is it possible to update "Modified by" and "CheckinComments" fields in Shaarepoint lists via WebServices? For the "Modified" field I first update the list to remove the ReadOnly attribute, then call UpdateListItems to change the field value and it works fine. The same scheme doesn't work for the fields mentioned above. What is the difference?

    Thanks for the answer!

    Elena.

כל התגובות

  • יום שלישי 03 אפריל 2012 20:16
     
     תשובה קוד כלול

    You cannot update the Modified By field even after making it not read only. You can use the lists.asmx CheckInFile method to update the checkincomments field.

     public static void UpdateListItemCheckIn(string url)
     {
                listservice.Lists listProxy = new listservice.Lists();
                listProxy.Url = "http://basesmcdev2/sites/tester1/_vti_bin/lists.asmx";
                listProxy.UseDefaultCredentials = true;
                bool success = listProxy.CheckInFile(url, "comment", "0");
    }


    Blog | SharePoint Field Notes Dev Tool | ClassMaster

  • יום שני 09 אפריל 2012 19:54
     
     
    Thank you very much! And is there any other way to update the "Modified by" field?
  • יום שלישי 24 אפריל 2012 06:20
    מנחה דיון
     
     תשובה

    For updating "Modified By", you can use the SharePoint object model. The detailed code is posted in the following thread:
    http://social.msdn.microsoft.com/Forums/en-US/sharepointdevelopment/thread/21f65f64-54d8-450f-b261-3d2f4ae42bd9


    Jinchun Chen
    Forum Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact tnmff AT microsoft.com(Please replace AT with @)

    • סומן כתשובה על-ידי Elena Yudovina יום שלישי 08 מאי 2012 14:48
    •  
  • יום שלישי 08 מאי 2012 14:47
     
     
    Yes, thanks. This problem is no longer actual.