London Dev Meetup Rescheduled! Due to unavoidable reasons, the event has been moved to 21st May. Speakers remain the same—any changes will be communicated. Seats are limited—register here to secure your spot!

Clear value of StopPublish

Vote:
0

I'm trying to clear the value of StopPublish of a page in code. How do I do this? I thought it would be a pretty simple thing to accomplish but it looks to be a lot harder.

#71541
May 22, 2013 11:40
Vote:
0
#71589
May 23, 2013 16:02
Vote:
0

Anyone?

#71591
May 23, 2013 16:03
Vote:
0

You don't specify which EPiServer version, but in both EPiServer 6 and 7 the procedure would go something like this:

var clone = CurrentPage.CreateWriteableClone();

clone["PageStopPublish"] = null;

DataFactory.Instance.Save(clone, SaveAction.Publish , AccessLevel.NoAccess);

    

What code are you trying?

#71598
Edited, May 23, 2013 20:42
Vote:
0

Hi,

We're still in version 5 but your code works. Thank you! I had only tried setting clone.StopPublish = null and that has failed for me.

Thanks again! Have a nice weekend!

#71630
May 24, 2013 15:40
Vote:
0

Glad to help. Please use the "Mark reply as answer" feature so others can see the thread is solved.

#71633
May 24, 2013 16:07
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.