November Happy Hour will be moved to Thursday December 5th.

Expire date

Vote:
 

Hi,

How to set the value to the "Expire date" field in the "Manage Expiration and Archiving" using code. 

Еhe second field on this form (Archive to) could override follows:

       public override PageReference ArchiveLink { get; set; }

 

Best regards,

Pavel

#76339
Oct 22, 2013 13:42
Vote:
 

Override the SetDefaultValues in your model.

 

public override void SetDefaultValues(ContentType contentType)
{
base.SetDefaultValues(contentType);

StopPublish = Set your date here

this.ArchiveLink = Set you archivelink here

}

#76341
Oct 22, 2013 13:57
Vote:
 

Thanks,

Your response has confirmed the correctness of my thoughts.

 

Solution:

1) Catch the next event: ServiceLocator.Current.GetInstance<IContentEvents>().PublishingContent

2) Field "StopPublish" changed in the event handler

#76343
Oct 22, 2013 14:27
This thread is locked and should be used for reference only. Please use the Episerver CMS 7 and earlier versions forum to open new discussions.
* 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.