Copied to clipboard

Flag this post as spam?

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


  • Chuck 71 posts 69 karma points
    Oct 14, 2011 @ 23:38
    Chuck
    0

    sender.getProperty question

    I'm new to .net so please be kind. I'm trying to build a class that creates a member when a node is created. I don't want the node to be published, however I need to get data from that node to create the member. The issue I run into is that if I publish the node I can do this.

    Document.AfterPublish += new Document.PublishEventHandler(Document_New);
    string distLogin = sender.getProperty("email").Value.ToString();

    This gives me the value of the email address the creator put in the document, however Like I said I don't want to publish the document, so I'd rather do this.

    Document.New += new Document.NewEventHandler(Document_New);
    string distLogin = sender.getProperty("email").Value.ToString();

    But when I do this, the value distLogin is blank... can I even get a value from a non published node?

  • bob baty-barr 1180 posts 1294 karma points MVP
    Oct 15, 2011 @ 00:36
    bob baty-barr
    0

    could you publish the node, get the value and then unPubllish the node?

    of course you would have to set a bit [true/false] on that docType and set it to checked so the doc does not unpublish every time it is published... only the first time.

    that should work, right?

  • Rodion Novoselov 694 posts 859 karma points
    Oct 15, 2011 @ 01:15
    Rodion Novoselov
    0

    I think it's possible to use BeforeSave or AfterSave events. Also you can try to use BeforePublish event and set e.Cancel = true inside the handler. 

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies