Starting off, I've not done much C# development so this is probably a syntax issue. I'm trying to reuse an SSIS script to update Dynamics CRM 2013 from this application. Before executing "public override bool Run", I need to authenticate first.
First I added the references (using the Dynamics CRM SDK) then tried injecting the SSIS script into the sample script.
The line
is causing the error
First I added the references (using the Dynamics CRM SDK) then tried injecting the SSIS script into the sample script.
The line
public override void PreExecute()
is causing the error
no suitable method found to overrideAny ideas how I should merge this code?
Code: Select all
public class MyAction : ScriptBasedAutomatedProcess
{
IOrganizationService organizationservice;
string CrmUrl = "";
string CrmDomainName = "";
string CrmUserName = "";
string CrmPassWord = "";
public override void PreExecute()
{
base.PreExecute();
CrmUrl = this.Variables.CrmWebservice.ToString();
CrmDomainName = this.Variables.CrmDomain.ToString();
CrmUserName = this.Variables.CrmUser.ToString();
CrmPassWord = this.Variables.CrmPassword.ToString();
ClientCredentials credentials = new ClientCredentials();
credentials.UserName.UserName = string.Format("{0}\\{1}", CrmDomainName, CrmUserName);
credentials.UserName.Password = CrmPassWord;
organizationservice = new OrganizationServiceProxy(new Uri(CrmUrl), null, credentials, null);
}
public override bool Run(MailMessage email, NameValueCollection fields)
{
Entity newContact = new Entity("contact");
newContact["emailaddress1"] = fields["From"];
organizationservice.Create(newContact);
}
}