Developer forum

Forum » Development » Creating news from code, and setting 2 date

Creating news from code, and setting 2 date


Reply
Hello everybody, I've created a small module that creates an AccessUser and a News in one click. It works great, with one exeption. When i open the created news from the admnistration the Active to year field is set to 1990, regardless of what i set it to from my code. my code looks like this --- Dynamicweb.NewsV2.NewsItem nyhed = new Dynamicweb.NewsV2.NewsItem(); /* Obligatoriske */ nyhed.NewsActive = true; nyhed.NewsActiveFrom = DateTime.Now; nyhed.NewsActiveTo = DateTime.Parse("2999-01-01 23:59:00"); nyhed.NewsDate = DateTime.Now; ... ... ... nyhed.Save() --- Any ideas? //Martin

Replies

 
Reply
Found the solution.

 

You must be logged in to post in the forum