Forums

 
  Support Forum  Modules  Engage: Publish  Object reference not set to instance of an object
Previous Previous
 
Next Next
New Post 7/14/2008 8:51 AM
  Derek Trauger
65 posts
http:\\www.derektrauger.com
6th Level Poster


Object reference not set to instance of an object 

 

While attempting to execute this code:

private void CreatePosting()
{
try
{
string name = "Migration Test Article Name";
string htmlEncoded = "<p>Migration Test Article<p>";
string description = "Migration Test Article Description";
int pageid = 74; //id of page to hold all articles, or top level page of a category
int portalid = 0; //current portal to import into
Article art = Article.Create(portalid);
art.ApprovalComments = "Auto Imported by Migration Process";
art.ApprovalStatusId = ApprovalStatus.Approved.GetId();
art.ApprovalUserId = 1;
art.ArticleText = HttpUtility.HtmlDecode(htmlEncoded);
art.AuthorUserId = 1;
art.CreatedDate = DateTime.Now.ToString();
art.LastUpdated = DateTime.Now.ToString();
art.Description = description;
art.DisplayTabId = pageid;
art.ItemTypeId = ItemType.Article.GetId();
art.LanguageId = 1;
art.Name = name;
art.StartDate = DateTime.Now.ToString();
art.PortalId = portalid;
art.Save(1);
}
catch (Exception ex)
{
TextBox1.Text = ex.Message.ToString();
}
}

at Engage.Dnn.Publish.Item.SendStatusUpdateEmail()
at Engage.Dnn.Publish.Item.UpdateApprovalStatus(IDbTransaction trans)
at Engage.Dnn.Publish.Article.Save(Int32 authorId)
at DesktopModules_ImportTool_ImportTool.CreatePosting()

It appeared this code was previously working now, I seem to be having issues executing it.

Any help is appreciated.

Derek 

 
New Post 7/14/2008 10:51 AM
  Derek Trauger
65 posts
http:\\www.derektrauger.com
6th Level Poster


Re: Object reference not set to instance of an object 

Not sure why but I uninstalled Publish and then re-installed and everything appears to be working correctly.

Thanks.

Derek

 
New Post 7/14/2008 11:10 AM
  Chris Hammond
1117 posts
1st Level Poster


Re: Object reference not set to instance of an object 

There are some bugs in the email functionality there for PUblish. They've been corrected for the next release.


Directory of Training Programs, DotNetNuke Corporation
 
Previous Previous
 
Next Next
  Support Forum  Modules  Engage: Publish  Object reference not set to instance of an object

Purchase

Please click here to buy now.
Payment will be processed via credit card or PayPal.

Please click here to buy now.
Payment will be processed via credit card or PayPal.

Test Drive!

Want to find out how it works? Visit our demo site to see the modules in actions!

Want to find out how it works? Visit our demo site to see the modules in actions!

Subscribe

Sign up for our newsletter and get the latest product updates!

Sign up for our newsletter and get the latest product updates!

Online Support

Powered by DotNetNuke