Copied to clipboard

Flag this post as spam?

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


  • Ben Divsalar 14 posts 34 karma points
    Feb 08, 2014 @ 23:39
    Ben Divsalar
    0

    DocumentType.GetByAlias returns null

    I have a very simple code to retrieve doc type by alias in umbraco 6.1.6

    I am using below code

    var dt =DocumentType.GetByAlias("TestDocType");
    or
    var dt = new
    DocumentType(1118);

    Both of above lines return null.  however  CMSNode returns the node details

    var dt = new CMSNode(1118); // returns node's details

    Please let me know what I am missing here.

    Regards

    Ben

  • Jeroen Breuer 4908 posts 12265 karma points MVP 4x admin c-trib
    Feb 10, 2014 @ 12:12
    Jeroen Breuer
    0

    Hello,

    Is 1118 the id of the node or the id of the documenttype? Could you post a screenshot where you have the documenttype opened? 

    Jeroen

  • Charles Afford 1163 posts 1709 karma points
    Feb 13, 2014 @ 22:50
    Charles Afford
    0

    Have you got the right alias?  What information by the doc type.

    I would use names alias rather than ids :)

Please Sign in or register to post replies

Write your reply to:

Draft