Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Isak Karlsson 2 posts 22 karma points
    Dec 02, 2010 @ 15:29
    Isak Karlsson
    0

    DocumentType .delete(). Cache error

    Hi.

    I'm trying to, using the api delete a DocumentType.

     

    I'm doing.

    List<DocumentType> docs = DocumentType.GetAllAsList();
    foreach (DocumentType doc in docs)
    {
        new DocumentType(doc.Id).delete(); // this one gives error
    }

    But im getting an error consering the cache. A Null pointer exception.

    How am I supposed to delete a DocumentType using the api?

  • Eduardo 106 posts 130 karma points
    Dec 04, 2010 @ 18:54
    Eduardo
    0

    Hi Isak,

    Test this code:

    List<DocumentType> docs = DocumentType.GetAllAsList();
    foreach (DocumentType doc in docs)
    {
        doc.delete();

    }

     

    HTH.

    Sincere regards,
    Eduardo

  • Isak Karlsson 2 posts 22 karma points
    Dec 04, 2010 @ 19:56
    Isak Karlsson
    0

    Thanks, Eduardo, But.

    It won't work.

    Same error, maybe I should have stated before that I've of course tried this.

    But I've solved it using the SqlHelper, and writing raw SQL-code, this feels though kind of stupid.

     

Please Sign in or register to post replies

Write your reply to:

Draft