This file contains 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
function showConfirmDialog() { | |
var confirmStrings = { | |
cancelButtonLabel: "Cancel button label, by default it's CANCEL", | |
confirmButtonLabel: "Confirm button label, by default it's OK", | |
text: "Text show on the dialog", | |
title: "Title of the confirmation dialog", | |
subtitle: "Subtitle of the confirmation dialog" | |
}; | |
var confirmOptions = { |
This file contains 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
function showAlertDialog() { | |
var alertStrings = { | |
confirmButtonLabel: "This is text shown on the confirmation button", | |
text: "This is text shown on the dialog" | |
}; | |
var alertOptions = { | |
height: 200, | |
width: 400 | |
}; |
This file contains 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 void DoRequest(IOrganizationService service) | |
{ | |
var request = new OrganizationRequest("ResolveEmailAddress"); | |
request.Parameters["EmailAddresses"] = "test@test.com"; | |
request.Parameters["ObjectTypeCodes"] = new int[] { 1, 2 }; | |
var response = service.Execute(request); | |
if (response.Results.Contains("Entities")) | |
{ | |
var result = (EntityCollection)response.Results["Entities"]; |
This file contains 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
namespace TransactionPlugin | |
{ | |
public class Autonumber : IPlugin | |
{ | |
public void Execute(IServiceProvider serviceProvider) | |
{ | |
var pluginContext = (IPluginExecutionContext)serviceProvider.GetService(typeof(IPluginExecutionContext)); | |
var factory = (IOrganizationServiceFactory)serviceProvider.GetService(typeof(IOrganizationServiceFactory)); | |
var service = factory.CreateOrganizationService(null); |
This file contains 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
namespace TransactionPlugin | |
{ | |
public class Autonumber : IPlugin | |
{ | |
public void Execute(IServiceProvider serviceProvider) | |
{ | |
var pluginContext = (IPluginExecutionContext)serviceProvider.GetService(typeof(IPluginExecutionContext)); | |
var factory = (IOrganizationServiceFactory)serviceProvider.GetService(typeof(IOrganizationServiceFactory)); | |
var service = factory.CreateOrganizationService(null); |
This file contains 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
namespace TransactionPlugin | |
{ | |
public class Autonumber : IPlugin | |
{ | |
public void Execute(IServiceProvider serviceProvider) | |
{ | |
var pluginContext = (IPluginExecutionContext)serviceProvider.GetService(typeof(IPluginExecutionContext)); | |
var factory = (IOrganizationServiceFactory)serviceProvider.GetService(typeof(IOrganizationServiceFactory)); | |
var service = factory.CreateOrganizationService(null); |
This file contains 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
var activityId = "059C0532-906C-E711-9409-00155D018D00"; | |
var activityType = "appointment"; //or any other entity type | |
var entity = {}; | |
entity["objectid_activitypointer@odata.bind"] = "/activitypointers(" + activityId + ")"; | |
entity.body = "ZGZnZA=="; //your file encoded with Base64 | |
entity.filename = "test"; | |
entity.subject = "test"; | |
entity.objecttypecode = activityType; |
This file contains 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
static void Main(string[] args) | |
{ | |
var solutionUniqueName = "SOLUTIONNAME"; | |
var orgService = new CrmServiceClient(ConfigurationManager.ConnectionStrings["CRM"].ConnectionString); | |
var solutionComponentQuery = new QueryExpression("solutioncomponent"); | |
solutionComponentQuery.Distinct = true; | |
solutionComponentQuery.ColumnSet.AddColumns("objectid", "componenttype", "solutioncomponentid"); | |
var solutioncomponentSolutionLink = solutionComponentQuery.AddLink("solution", "solutionid", "solutionid"); | |
solutioncomponentSolutionLink.EntityAlias = "aa"; | |
solutioncomponentSolutionLink.LinkCriteria.AddCondition("uniquename", ConditionOperator.Equal, solutionUniqueName); |
This file contains 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
function changeCompositeFieldLabel(attributeName, label) { | |
var attribute = Xrm.Page.getAttribute(attributeName); | |
if (attribute != null) { | |
attribute.controls.forEach(function (c) { | |
c.setLabel(label); | |
}); | |
} | |
} | |
//Usage |
This file contains 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 TransactionPlugin : IPlugin | |
{ | |
public void Execute(IServiceProvider serviceProvider) | |
{ | |
var context = (IPluginExecutionContext)serviceProvider.GetService(typeof(IPluginExecutionContext)); | |
var factory = (IOrganizationServiceFactory)serviceProvider.GetService(typeof(IOrganizationServiceFactory)); | |
var service = factory.CreateOrganizationService(null); | |
var counter = GetCounter(service); | |
counter["new_name"] = "lockme"; |