I am having trouble inserting new record in "Clients" list on our server, I am in learning phase for working with SharePoint Lists Web Services and I am trying to insert a new item in a list which contains ID of another list item.
Following is my code for setting lookup column value before sending data to webservice
.
batch.InnerXml = "<Method ID='1' Cmd='New'>"
+ "<Field Name='" + Constants.Client_Field_FirstName + "'>" + clientObj.FirstNameOfIndividual + "</Field>"
+ "<Field Name='" + Constants.Client_Field_MiddleInitial + "'>" + clientObj.MiddleNameOfIndividual + "</Field>"
//Save parent id's
+ "<Field Name='" + Constants.CLIENT_FIELD_PARENT_ID + "'>" + string.Format("{0};#", clientObj.ParentCaregiver1ID) + "</Field>"
+ "<Field Name='" + Constants.CLIENT_FIELD_PARENT_ID + "'>" + string.Format("{0};#", clientObj.ParentCaregiver2ID) + "</Field>"
+ "</Method>";
Basically I want Parent 1
and Parent 2 ID's
to be inserted for new client. I don't know what is missing here. Client is added to the list and there is no error message but Parent ID's are blank.
Am I using right format for inserting lookup column value?
Please help.