Clear value of StopPublish

Vote:
 

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:
 
#71589
May 23, 2013 16:02
Vote:
 

Anyone?

#71591
May 23, 2013 16:03
Vote:
 

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:
 

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:
 

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.