질문하기질문하기
 

질문MoveTo() function not working

  • 2009년 7월 1일 수요일 오전 6:41Arup R 사용자 메달사용자 메달사용자 메달사용자 메달사용자 메달
     

    Hi,

    I have two lists (listA and listB) within same site and same column. I want to move item from listA to listB by using SPFile.MoveTo() function.

    without giving any error it is moving from listA but unfortunately it is not showing to target/destination list named listB. I am surprised because of this kind behaviour. If there is no error then where were my moved items?

    after developing console application, this SPfile.moveto() function worked for me for 3-4 time but then it will behave like as stated above.

    thanks in advance...

     


    --- Arup R(MCTS) Success does not Matter.

모든 응답

  • 2009년 7월 3일 금요일 오후 5:13Arup R 사용자 메달사용자 메달사용자 메달사용자 메달사용자 메달
     
    Hi All Members,

    no one has knowledge? it's surprising !!



    --- Arup R(MCTS) Success does not Matter.
  • 2009년 7월 3일 금요일 오후 5:26RaghavanS 사용자 메달사용자 메달사용자 메달사용자 메달사용자 메달
     
    Hi Arup,

    Can you post your complete code.. this will help adressing this issue..
    Raghavan
  • 2009년 7월 3일 금요일 오후 5:30Steve.CurranMVP사용자 메달사용자 메달사용자 메달사용자 메달사용자 메달
     
    The MoveTo method has three overloads. Can you tell us which one you are calling. If you are setting the argument to overwrite then no error will occur and you maybe overwriting an existing document and you do not know it. How are you verifying that the document did not get moved?
    certdev.com
  • 2009년 7월 3일 금요일 오후 6:43Arup R 사용자 메달사용자 메달사용자 메달사용자 메달사용자 메달
     
    Hi Steve,
    I have used simple MoveTo() method. Again explaining I have two list
    a. LISTA
    b. LISTB

    LISTA has 5 items and LISTB has no item right now. both list has same columns and schema.

    after exceuting it's deteting item from LISTA but it's not adding to LISTB and no erros come. Item is surprisingly disappear. mention one ineterseting thing is MoveTo() is working to move item into different folder within same list.

    any one there to solve this magic...

    Note: code is not throwing any exception and item also not moving successfully.

    --- Arup R(MCTS) Success does not Matter.
  • 2009년 7월 3일 금요일 오후 8:24Sébastien Sougnez 사용자 메달사용자 메달사용자 메달사용자 메달사용자 메달
     
    ... Copy paste your code instead of repeating the same thing twice...

    http://www.areaprog.com
  • 2009년 7월 6일 월요일 오전 11:57Arup R 사용자 메달사용자 메달사용자 메달사용자 메달사용자 메달
     코드 있음
    SPList spList = spWeb.Lists["ListA"];
    SPList targetList = spWeb.Lists["ListB"];
    SPListItem item = spList.GetItemById(1);
    SPFile item_file = spWeb.GetFile(item.Url);
    item_file.MoveTo(DestinationURL + "/" + item_file.Name, SPMoveOperations.Overwrite);
    targetList.Update();
    spList.Update();
    <br/>
    
    please see the code sample above...

    --- Arup R(MCTS) Success does not Matter.
  • 2009년 7월 10일 금요일 오전 10:18Arup R 사용자 메달사용자 메달사용자 메달사용자 메달사용자 메달
     
    anyone ....

    I have pasted my code sample...

    ...
    THanks! Arup R(MCTS) SucCeSS DoEs NOT MatTer.
  • 2009년 7월 10일 금요일 오전 10:33kancharla 사용자 메달사용자 메달사용자 메달사용자 메달사용자 메달
     
    Hi Arup,


    It is not good idea MoveTo methode to send file from one  library another library in sharepoint.


    Better to use SPImportSettings and SPExportSettings to move files between librarys....



    MoveTo methode is having lot of problems. I also faced the same problems. So, I got the solution for my problem with the abou mentioned Objects..


    Njoy sharepoint coding....


    Regards,
    Srikanth
    Kancharla....