Posted on 11/08/2014 16:34:40
that helped with the initial problem but now i get a nullreference error.
it doesn't seem to enter the RunJob method, and it doesn't give an error when its commmented out.
using System;
using System.Collections.Generic;
using System.Xml;
using Dynamicweb.Data.Integration;
using Dynamicweb.Data.Integration.Interfaces;
using Dynamicweb.Extensibility;
using Dynamicweb.Data.Providers;
using System.Data.SqlClient;
namespace Dynamicweb.eCommerce.LiveIntegration
{
//AddInName attribute required in order to make the source show up in the GUI
[AddInName("My.Custom.CustomDWDestinationProvider"), AddInLabel("My example destination provider"), AddInDescription("My example destination provider")]
public class CustomDWDestinationProvider : DynamicwebProvider, IDestination
{
public CustomDWDestinationProvider()
: base()
{
}
public CustomDWDestinationProvider(string connectionString)
: base(connectionString)
{}
public CustomDWDestinationProvider(XmlNode xmlNode)
: base(xmlNode)
{
}
public override bool RunJob(Job job, string logFile)
{
try
{
Logger.Log("Custom Provider");
var importSuccess = base.RunJob(job, logFile);
var success = false;
if (importSuccess)
{
Logger.Log("Starting cleaning of imported data");
foreach (Dynamicweb.eCommerce.Products.Group gr in Dynamicweb.eCommerce.Products.Group.GetAllGroups())
{
gr.Description = Helpers.CleanContent(gr.Description);
}
success = true;
Logger.Log("Finished cleaning of imported data");
}
}
catch (Exception ex)
{
Logger.Log("Import job failed: " + ex.Message);
return false;
}
return true;
}
}
}
Log:
Tid
|
|
|
Besked
|
|
|
11-08-2014 16:08:57
|
Batch failed.
|
|
11-08-2014 16:08:57
|
Finished job - ErpDataImportV2.
|
|
11-08-2014 16:08:57
|
Error occured: Object reference not set to an instance of an object.
|
|
11-08-2014 16:08:33
|
reading configuration
|
|
11-08-2014 16:08:32
|
Starting job - ErpDataImportV2.
|
|
11-08-2014 16:08:31
|
Starting batch
|
|
|