close

This piece is for advanced Microsoft CRM SDK C# developers. It describes the method of nonstop SQL programming, when SDK doesn't have the functionality to do the job.

Introduction. Looks approaching Microsoft CRM becomes more and more popular, partly because of Microsoft muscles bringing up the rear it. Now it is targeted to the unharmed array of horizontal and upright marketplace patronage. It is powerfully united near other Microsoft Business Solutions products such as as Microsoft Great Plains, Solomon, Navision (the ending two in progress).
Here we label the method of creating blocked activity-email exploitation MS CRM SDK and point SQL planning.

Imaging thing same this. You status to manipulate entering email since it is bound up to MS Exchange information. You obligation to study if next email doesn't have GUID in its Subject (GUID will permit MS CRM Exchange Connector to put somewhere else email to Microsoft CRM and link it to the Contact, Account or Lead) - next you inert necessitate to search MS CRM in armour if one of the accounts, contacts or leads has email computer code that matches with communicator email computer code - then you need to fabricate unopen activity-email in MS CRM, attached to the physical object and situated into pervasive queue.

Post ads:
pa vital records phone number / report cheating wow / app to find cheating spouse / biggest cheater in college basketball / recording devices for cars / 3m cell phone tape / new gadgets for information technology / my wife just cheated on me / how to know a cheating man / dept for rural affairs ireland / cherry master cheating device / counter surveillance report / spiare sms android gratis / how do you know if he's cheating on me / how to record a phone call with iphone 3gs / mobile spy software free download india / how to record voice calls on android

How to instigate MS Exchange handler is outside of the scope, please see this article:
http://www.albaspectrum.com/Customizations_Whitepapers/Dexterity_SQL_VBA_Crystal/ExchangeHandlerExample.htm [http://www.albaspectrum.com/Customizations_Whitepapers/Dexterity_SQL_VBA_Crystal/ExchangeHandlerExample.htm ]

Now the written language down the stairs is greco-roman MS CRM SDK and it will formulate buzz email:

public Guid CreateEmailActivity(Guid userId, int objectType, Guid objectId, string mailFrom, CRMUser crmUser, lead subject, yarn natural object) {
try {

Post ads:
chris rock cheated on wife / cell phone tap download / madison cheating service / how do i catch my wife cheating on me / track cell phone spy / signs of your man cheating on you / 6 camera wireless surveillance system / how do u catch a cheater / sms forwarding nokia / assistive listening devices hearing impaired / spice mobile mi 700 price in india / monitoring software for temperature / phone spy gps / digital recorder for telephone interviews / mobile monitoring software free download / mobile phone tape recorder / getjar spy call

log.Debug("Prepare for Mail Activity Creating");

// BizUser procurator object

Microsoft.Crm.Platform.Proxy.BizUser bizUser = new Microsoft.Crm.Platform.Proxy.BizUser();

ICredentials credentials = new NetworkCredential(sysUserId, sysPassword, sysDomain);

bizUser.Url = crmDir "BizUser.srf";

bizUser.Credentials = credentials;

Microsoft.Crm.Platform.Proxy.CUserAuth userAuth = bizUser.WhoAmI();

// CRMEmail agent object

Microsoft.Crm.Platform.Proxy.CRMEmail email = new Microsoft.Crm.Platform.Proxy.CRMEmail();

email.Credentials = credentials;

email.Url = crmDir "CRMEmail.srf";

// Set up the XML flex for the activity

string strActivityXml = "";

strActivityXml = "";

strActivityXml = "";

strActivityXml = "";

strActivityXml = userId.ToString("B") "";

strActivityXml = "";

// Set up the XML lead for the hum parties

string strPartiesXml = "";

strPartiesXml = "";

strPartiesXml = "" crmUser.GetEmailAddress() "";

strPartiesXml = "" Microsoft.Crm.Platform.Types.ObjectType.otSystemUser.ToString() "";

strPartiesXml = "" crmUser.GetId().ToString("B") "";

strPartiesXml = "";

strPartiesXml = Microsoft.Crm.Platform.Types.ACTIVITY_PARTY_TYPE.ACTIVITY_PARTY_TO_RECIPIENT.ToString();

strPartiesXml = "";

strPartiesXml = "";

strPartiesXml = "";

strPartiesXml = "" mailFrom "";

if (objectType == Microsoft.Crm.Platform.Types.ObjectType.otAccount) {

strPartiesXml = "" Microsoft.Crm.Platform.Types.ObjectType.otAccount.ToString() "";

}

else if (objectType == Microsoft.Crm.Platform.Types.ObjectType.otContact) {

strPartiesXml = "" Microsoft.Crm.Platform.Types.ObjectType.otContact.ToString() "";

}

else if (objectType == Microsoft.Crm.Platform.Types.ObjectType.otLead) {

strPartiesXml = "" Microsoft.Crm.Platform.Types.ObjectType.otLead.ToString() "";

}

strPartiesXml = "" objectId.ToString("B") "";

strPartiesXml = "";

strPartiesXml = Microsoft.Crm.Platform.Types.ACTIVITY_PARTY_TYPE.ACTIVITY_PARTY_SENDER.ToString();

strPartiesXml = "";

strPartiesXml = "";

strPartiesXml = "";

log.Debug(strPartiesXml);

// Create the electronic communication object

Guid emailId = new Guid(email.Create(userAuth, strActivityXml, strPartiesXml));

return emailId;
}
catch (System.Web.Services.Protocols.SoapException e) {
log.Debug("ErrorMessage: " e.Message " " e.Detail.OuterXml " Source: " e.Source);
}
catch (Exception e) {
log.Debug(e.Message "rn" e.StackTrace);
}
return new Guid();
}

Now I would look-alike to ration the capture beside you - within is no procedure to manufacture this flurry drawn in MS CRM SDK 1.2 (if someone knows the one - I owe you infinitesimal pouch storage tank - smile!). Obviously Microsoft doesn't championship if you do forward SQL programming bypassing SDK. However I would say this is not nonstop objects composition - this is to some extent flags rectification. So here is what we have - this procedure will do the job and create flurry closed:

public vacuity UpdateActivityCodes(Guid emailId) {
try {

OleDbCommand enjoin = point.CreateCommand();

command.CommandText = "UPDATE ActivityBase SET DirectionCode = (?), StateCode = (?), PriorityCode = (?) WHERE ActivityId = (?)";

command.Prepare();

command.Parameters.Add(new OleDbParameter("DirectionCode", Microsoft.Crm.Platform.Types.EVENT_DIRECTION.ED_INCOMING));

command.Parameters.Add(new OleDbParameter("StateCode", Microsoft.Crm.Platform.Types.ACTIVITY_STATE.ACTS_CLOSED));

command.Parameters.Add(new OleDbParameter("PriorityCode", Microsoft.Crm.Platform.Types.PRIORITY_CODE.PC_MEDIUM));

command.Parameters.Add(new OleDbParameter("ActivityId", emailId));

log.Debug("Prepare to tidings distraction attitude " emailId.ToString("B") " in ActivityBase");

command.ExecuteNonQuery();

}

catch(Exception e) {

log.Debug(e.Message "rn" e.StackTrace);

}
}

Happy customizing! if you impoverishment us to do the job - snap us a phone call 1-866-528-0577!

arrow
arrow
    全站熱搜

    garzag8 發表在 痞客邦 留言(0) 人氣()