Copied to clipboard

Flag this post as spam?

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


  • awm 187 posts 376 karma points
    Jan 17, 2013 @ 13:01
    awm
    0

    How do I set a pre value programmatically?

    Hi guys,

    I'm trying to add a list of nodes programmatically and I'm having trouble setting a property that is selected via a dropdown in the cms.

    At the moment I have:

    Document d = Document.MakeNew(rawApartment.AptNo.ToString(), DocumentType.GetByAlias("Apartment"), User.GetCurrent(), GetParentNodeId(rawApartment.Building));
    d.getProperty("status").Value = rawApartment.Status;                
    d.Publish(author);
    umbraco.library.UpdateDocumentCache(d.Id);

    Where 'rawApartment.Status' is a string that matches the string in the dropdown text however when I check the nodes in the back-end, the dropdown value I entered isn't selected.

    I checked the umbraco.config and it's storing the string value so it's not a case of me having to set the prevalue id.

    How do I do this?

  • nickornotto 403 posts 907 karma points
    Feb 27, 2014 @ 13:41
    nickornotto
    0

    Did you get to any solution? I'm having the same problem. Thanks

Please Sign in or register to post replies

Write your reply to:

Draft