Date field not updated using updatelistitems - InfoPath Dev
in

InfoPath Dev

Date field not updated using updatelistitems

Last post 05-04-2006 01:01 PM by spr. 6 replies.
Page 1 of 1 (7 items)
Sort Posts: Previous Next
  • 04-14-2006 02:07 AM

    • gaurs
    • Not Ranked
    • Joined on 04-04-2006
    • India
    • Posts 12

    Date field not updated using updatelistitems

    I am trying to use updatelistitems method of lists webservice to update a custom list. It works great for text/number columns but when I try to update date column, no error is returned but column does not get updated in the custom list. Problem also with lookup columns and person/group columns. Any pointers would be greatly appreciated.
  • 04-15-2006 11:53 PM In reply to

    Re: Date field not updated using updatelistitems

    Hi Gaurs,
    Probably has something to do with type of data since SQL datetime is different from the XML data type in InfoPath.
    Patrick Halstead
    Project Manager at Qdabra
  • 04-16-2006 08:59 PM In reply to

    • gaurs
    • Not Ranked
    • Joined on 04-04-2006
    • India
    • Posts 12

    Re: Date field not updated using updatelistitems

    How can I find that? Or is there a way in which I can query the SQL format and then convert to that format?
  • 04-19-2006 02:09 AM In reply to

    • gaurs
    • Not Ranked
    • Joined on 04-04-2006
    • India
    • Posts 12

    Re: Date field not updated using updatelistitems

    I could get the date field to update properly. But I am unble to update a lookup field.
    I have a Request ID - text field on the doc library. This will be unique. Then I have another doc library where I have a lookup column which refers to Request ID of the prev lib. How do I update the lookup column value. If I psecify the requedt ID directly, it does not work.
    I came across some information that to update lookup column, you have to give the ID of the references list/doc entry. However this is not working for me. Could someone share exact format for this.

    This is my code:

    string myPlan = string.Format(
    "<Method ID='1' Cmd='Update'>" +
    "<Field Name='ID'>" + docId +"</Field>" +
    "<Field Name='FileRef'>" + myUrl "</Field>" +
    //"<Field Name='RequestId'>{0}</Field>" +
    "<Field Name='SupportPlanId'>{0}</Field>" +
    "</Method>",
    ---->>>> //requestId,
    supportPlanId);


    How do I specify the correct ID in the code marked with arrow?
  • 04-23-2006 02:17 AM In reply to

    Re: Date field not updated using updatelistitems

    Sharepoint gives an unique ID value for each row. You will have to first call GetListItems to get the ID of the specific row whose value you want to use to update the Look up field. Now that you have the ID field value, use that as input value.

    There is some code athttp://weblogs.asp.net/bsimser/archive/2005/05/13/406734.aspx that might help.

    Hope this helps!
    Shanthi Reddy
  • 04-24-2006 12:25 AM In reply to

    Re: Date field not updated using updatelistitems

    Hi,

    i havent tried with update, but with Cmd='New' i havent had any problems (as long as its a valid lookup ID ofcourse (in the solution i delete and create new)

    string strBatch = "<Method ID='" + number + "' Cmd='New'>" +
    "<Field Name='ID'>New</Field>" +
    "<Field Name='Title'><![CDATA[" + equipmentText + "]]></Field>" +
    "<Field Name='Equipment_x0020_Type'><![CDATA[" + typeText + "]]></Field>" +
    "<Field Name='Recommendation'><![CDATA[" + recommendationText + "]]></Field>" +
    "<Field Name='Area'>" + areaID + "</Field>" +
    "</Method>";

    hth
  • 05-04-2006 01:01 PM In reply to

    • spr
    • Not Ranked
    • Joined on 05-04-2006
    • Posts 3

    Re: Date field not updated using updatelistitems

    Hi all
    Will you please tell me how to write CAML to delete listitem.
Page 1 of 1 (7 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.