Skip to main content

Hi All,

 

I'm trying to copy a list item into folder in a document library.

I have used the "Lists.asmx" webservice for it and the "UpdateListItems" webmethod.

Below is my XML, I have used a "FileDirRef" to provide the folder under which I need to copy the item.

But the item is been copied outside the folder at the library level.

 

XML

<m:UpdateListItems>

      <m:listName>Archival List</m:listName>

      <m:updates>

        <Batch OnError="Continue" ListVersion="1" ViewName="">

          <Method ID="1" Cmd="New">

            <Field Name="er">Test</Field>

            <Field Name="FileDirRef">ÂSite URL]/Sites/C0001968/Archival List/18-May-2015</Field>

          </Method>

        </Batch>

      </m:updates>

    </m:UpdateListItems>

 

Output:

78936_pastedImage_1.png

 

Can someone please tell where I'm going wrong.

Thanks in Advance

 

Regards,

Shyam

Hi Andrew,

I have tried using "Copy.asmx" webservice and the CopyIntoItems method.

XML

<m:CopyIntoItems>

      <m:SourceUrl>lSite URL]/Sites/C0001968/Lists/PPV%20List/AllItems.aspx</m:SourceUrl>

      <m:DestinationUrls>

        <m:string> Site URL]/Sites/C0001968/Archival%20List/18-May-2015</m:string>

      </m:DestinationUrls>

      <m:Fields>

        <m:FieldInformation Type="Text" DisplayName="er" Value="Test"></m:FieldInformation>

      </m:Fields>

      <m:Stream>base64Binary</m:Stream>

    </m:CopyIntoItems>

But, I'm getting an error,

Response

<CopyIntoItemsResult>0</CopyIntoItemsResult>

      <Results>

        <CopyResult ErrorCode="Unknown" ErrorMessage="A file with the name Archival List/18-May-2015 already exists. It was last modified by i:0#.w|commonssh6626 on 18 mei 2015 09:13:49 +0200." DestinationUrl="mSite URL]/Sites/C0001968/Archival%20List/18-May-2015" />

      </Results>

    </CopyIntoItemsResponse>

Could you please help me with this.

Thanks in Advance.

Regards,

Shyam


Hi Andrew,

Thanks for the reply.

I could achieve the required functionality. happy.png

Regards,

Shyam


Reply