This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Security.Cryptography; | |
using System.Text; | |
using System.Text.RegularExpressions; | |
namespace Microsoft.Crm | |
{ | |
public sealed class ChecksumGenerator : IChecksumGenerator |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void Main() | |
{ | |
string prefix = "new"; | |
var sourceConnectionString = $@"Url=https://SOURCE.crm.dynamics.com;AuthType=Office365;UserName=USERNAME;Password=PASSWORD;RequireNewInstance=true;"; | |
var targetConnectionString = $@"Url=https://TARGET.crm.dynamics.com;AuthType=Office365;UserName=USERNAME;Password=PASSWORD;RequireNewInstance=true;"; | |
var sourceCrmSvcClient = new CrmServiceClient(sourceConnectionString); | |
var targetCrmSvcClient = new CrmServiceClient(targetConnectionString); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class SomeActionLogic : PortalWebServiceLogicBase | |
{ | |
private IOrganizationService _orgService; | |
private ITracingService _traceService; | |
private Input _input; | |
public class Input | |
{ | |
public string String1 { get; set; } | |
public string String2 { get; set; } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Reference Microsoft.IdentityModel.Clients.ActiveDirectory NuGet package aka ADAL | |
private const string API_BASE_URL = "https://oauthtest4.crm.dynamics.com/"; | |
private const string API_URL = "https://oauthtest4.crm.dynamics.com/api/data/v8.1/"; | |
private const string CLIENT_ID = "YOUR CLIENT ID"; | |
private const string USERNAME = "[email protected]"; | |
private const string PASSWORD = "YOUR PASSWORD"; | |
static void Main(string[] args) | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private void SendStatusUpdate(int complete, int total) | |
{ | |
using (var smtp = new SmtpClient("smtp.office365.com", 587) | |
{ | |
Credentials = new NetworkCredential("<USERNAME>", "<PASSWORD>"), | |
EnableSsl = true | |
}) | |
{ | |
smtp.Send("<FROM EMAIL>", "<TO EMAIL>", $"Progress Update {complete}/{total}", null); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
orgService.Execute(new UpdateRequest | |
{ | |
Target = new Entity("contact") | |
{ | |
Id = <ContactB id>, | |
Attributes = | |
{ | |
{"jobtitle", "Developer"} | |
} | |
}, |