Fazer uma PerguntaFazer uma Pergunta
 

PerguntaMoveTo() function not working

  • quarta-feira, 1 de julho de 2009 6:41Arup R Medalhas de usuárioMedalhas de usuárioMedalhas de usuárioMedalhas de usuárioMedalhas de usuário
     

    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.

Todas as Respostas

  • sexta-feira, 3 de julho de 2009 17:13Arup R Medalhas de usuárioMedalhas de usuárioMedalhas de usuárioMedalhas de usuárioMedalhas de usuário
     
    Hi All Members,

    no one has knowledge? it's surprising !!



    --- Arup R(MCTS) Success does not Matter.
  • sexta-feira, 3 de julho de 2009 17:26RaghavanS Medalhas de usuárioMedalhas de usuárioMedalhas de usuárioMedalhas de usuárioMedalhas de usuário
     
    Hi Arup,

    Can you post your complete code.. this will help adressing this issue..
    Raghavan
  • sexta-feira, 3 de julho de 2009 17:30Steve.CurranMVPMedalhas de usuárioMedalhas de usuárioMedalhas de usuárioMedalhas de usuárioMedalhas de usuário
     
    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
  • sexta-feira, 3 de julho de 2009 18:43Arup R Medalhas de usuárioMedalhas de usuárioMedalhas de usuárioMedalhas de usuárioMedalhas de usuário
     
    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.
  • sexta-feira, 3 de julho de 2009 20:24Sébastien Sougnez Medalhas de usuárioMedalhas de usuárioMedalhas de usuárioMedalhas de usuárioMedalhas de usuário
     
    ... Copy paste your code instead of repeating the same thing twice...

    http://www.areaprog.com
  • segunda-feira, 6 de julho de 2009 11:57Arup R Medalhas de usuárioMedalhas de usuárioMedalhas de usuárioMedalhas de usuárioMedalhas de usuário
     Contém Código
    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.
  • sexta-feira, 10 de julho de 2009 10:18Arup R Medalhas de usuárioMedalhas de usuárioMedalhas de usuárioMedalhas de usuárioMedalhas de usuário
     
    anyone ....

    I have pasted my code sample...

    ...
    THanks! Arup R(MCTS) SucCeSS DoEs NOT MatTer.
  • sexta-feira, 10 de julho de 2009 10:33kancharla Medalhas de usuárioMedalhas de usuárioMedalhas de usuárioMedalhas de usuárioMedalhas de usuário
     
    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....