Copied to clipboard

Flag this post as spam?

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


  • Edgar Rasquin 174 posts 467 karma points
    Feb 20, 2018 @ 13:55
    Edgar Rasquin
    0

    How to set publish at and unpublish at date in contentservice ?

    Hi there,

    I have been wondering how I can set the publish at and unpublish dates from within the method of a webservice:

    enter image description here

    All my custom fields are set by using code like the following:

    var newproduct = contentService.CreateContentWithIdentity(Headline, parentId, "product");
    
                product.SetValue("sortDate", SortDate);
    

    But how can I address the fields for publish and unpublish?

    Any ideas?

  • Steve Morgan 1278 posts 4216 karma points c-trib
    Feb 20, 2018 @ 14:02
    Steve Morgan
    100

    Hi, I think you're looking for:

    newproduct.ReleaseDate;
    newproduct.ExpireDate;
    

    Credit due to Tim via https://stackoverflow.com/questions/7444042/umbraco-how-can-i-get-publish-at-remove-at-date-using-c-sharp/7444389#7444389

  • 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