Developer forum

Forum » Development » AddIn Parameters not loaded correctly

AddIn Parameters not loaded correctly

Daniel Kousholt
Reply

Hi,

I've created a Scheduled Task Addin, making it possible to create my own custom code when the scheduled task is running.

I have a FileSelectEditor-'Add-In-Parameter' in my code so that I from DW can add a path to a file in my solution. When I add a path it is save as xml in the database in the column "TaskAddinSettings". Which is fine. My problem is that when i in DW selects another file, hit OK and re-opens my scheduled task the value in the field is empty (not in the DB - only in DW). If I opens my scheduled task and hit cancel and after this re-opens my scheduled task the value in the field is back. Any idea of what is going on?

The Source code is as follows:

namespace CustomerName.Logic.AddIns.ScheduledTaskAddIns

{

using Dynamicweb.Extensibility;

using Dynamicweb.Extensibility.Editors;

using Dynamicweb.Extensibility.ScheduledTaskAddins;

[AddInDescription("Import products from perfion xml")]

[AddInIgnore(false)]

[AddInLabel("Import products from perfion xml")]

[AddInName("CustomerName.Logic.AddIns.ScheduledTaskAddIns.ImportPerfionProducts")]

public class ImportPerfionProducts : BaseScheduledTaskAddIn

{

[AddInParameterEditor(typeof(FileSelectEditor), "NewGUI=true;inputClass=NewUIinput;extensions=xml;folder=/files/import;"), AddInParameter("Source File")]

public string SourceFile { get; set; }

public override bool Run()

{

//do something

return true;

}

}

}

 


Replies

 

You must be logged in to post in the forum