|
Home > Archive > Microsoft Content Management Server > May 2005 > ExpiryDate
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
|
|
|
| Hi,
I have a Problem. I copy a Posting and then i want change the
ExpiryDate of the copy. But the Date dont change. Why??
Regards,
Oli
| |
| Stefan [MSFT] 2005-05-09, 5:50 pm |
| Hi Oli,
are you doing this using Webauthor or using code?
If code: please post your code here.
Thanks,
Stefan
--
This posting is provided "AS IS" with no warranties, and confers no rights
New to MCMS?
Check out this book: Building Websites Using MCMS: http://tinyurl.com/6zj44
----------------------
"Oli" <Oli@discussions.microsoft.com> wrote in message
news:6ED3B95F-8F70-4CF9-B679-A989F57C2CFF@microsoft.com...
> Hi,
>
> I have a Problem. I copy a Posting and then i want change the
> ExpiryDate of the copy. But the Date dont change. Why??
>
> Regards,
>
> Oli
>
>
| |
|
| Hi Stefan,
I using Code to copy the Posting.
Here is my Code:
Channel SubChannel = (Channel)
currentCmsContext.Searches.GetByPath("/Channels/intranet/news/" + group +
"/archiv");
NewPosting = currentPosting.CopyTo(SubChannel);
NewPosting.ExpiryDate = DateTime.Now.AddYears(1);
NewPosting.StartDate = DateTime.Now.AddMonths(2);
NewPosting.Approve();
currentCmsContext.CommitAll();
Regards,
Oli
"Stefan [MSFT]" wrote:
> Hi Oli,
>
> are you doing this using Webauthor or using code?
> If code: please post your code here.
>
> Thanks,
> Stefan
>
> --
> This posting is provided "AS IS" with no warranties, and confers no rights
>
> New to MCMS?
> Check out this book: Building Websites Using MCMS: http://tinyurl.com/6zj44
> ----------------------
>
>
> "Oli" <Oli@discussions.microsoft.com> wrote in message
> news:6ED3B95F-8F70-4CF9-B679-A989F57C2CFF@microsoft.com...
>
>
>
| |
| Stefan [MSFT] 2005-05-09, 5:50 pm |
| Hi Oli,
did you retrieve the currentPosting using the currentCmsContext? This piece
of code is missing.
If yes I would suggest to a some commits between the lines to see if it
works then:
Channel SubChannel = (Channel)
currentCmsContext.Searches.GetByPath("/Channels/intranet/news/" + group +
"/archiv");
NewPosting = currentPosting.CopyTo(SubChannel);
currentCmsContext.CommitAll();
NewPosting.ExpiryDate = DateTime.Now.AddYears(1);
NewPosting.StartDate = DateTime.Now.AddMonths(2);
currentCmsContext.CommitAll();
NewPosting.Approve();
currentCmsContext.CommitAll();
Sometimes there are glitches if changes are only done in memory and not
commited back to the database - especially when changes are done to the page
object (holding the content) and posting object (holding the properties) in
parallel.
Cheers,
Stefan
--
This posting is provided "AS IS" with no warranties, and confers no rights
New to MCMS?
Check out this book: Building Websites Using MCMS: http://tinyurl.com/6zj44
----------------------
"Oli" <Oli@discussions.microsoft.com> wrote in message
news:AF107AE9-7164-49CF-AC47-40AA1D9405B2@microsoft.com...[vbcol=seagreen]
> Hi Stefan,
>
> I using Code to copy the Posting.
>
> Here is my Code:
>
> Channel SubChannel = (Channel)
> currentCmsContext.Searches.GetByPath("/Channels/intranet/news/" + group +
> "/archiv");
> NewPosting = currentPosting.CopyTo(SubChannel);
> NewPosting.ExpiryDate = DateTime.Now.AddYears(1);
> NewPosting.StartDate = DateTime.Now.AddMonths(2);
> NewPosting.Approve();
> currentCmsContext.CommitAll();
>
> Regards,
>
> Oli
>
> "Stefan [MSFT]" wrote:
>
|
|
|
|
|