Skip to content

Instantly share code, notes, and snippets.

<?xml version="1.0" encoding="utf-8"?>
<Weavers>
<Costura>
<IncludeAssemblies>
Foo.Crm.External
</IncludeAssemblies>
<Target
AfterTargets="AfterBuild;NonWinFodyTarget"
Name="CleanReferenceCopyLocalPaths" >
<Delete Files="@(ReferenceCopyLocalPaths->'$(OutDir)%(DestinationSubDirectory)%(Filename)%(Extension)')" />
@gashupl
gashupl / CrmTurboFormTest.js
Created August 26, 2016 10:36
Dynamics CRM script presenting TurboForms OnChange events behavior
function FormOnLoad(){
var eventHandler = function(executionContext){
alert(executionContext.getEventSource().getName());
}
var attributes = Xrm.Page.getAttribute();
attributes.forEach(function(element) {
element.addOnChange(eventHandler);
});
@gashupl
gashupl / Program.cs
Created September 30, 2016 11:34
RSA Encrypting & Descrypting in C# sample
using System;
using System.Security.Cryptography;
using System.Text;
namespace RsaEncryptionSample
{
class Program
{
static void Main(string[] args)
{
@gashupl
gashupl / 1045.json
Created October 6, 2016 08:17
Polish alphabet file for CRM Early Bound Generator
{
"code": 1045,
"language": "Polish",
"alphabet": [
[ "ą", "a" ],
[ "Ą", "A" ],
[ "ó", "o" ],
[ "Ó", "O" ],
[ "ę", "e" ],
[ "Ę", "E" ],
using System;
namespace XrmLabs.Library
{
public class Worker
{
public Worker() { }
private void DoSecretJob()
{
using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using XrmLabs.Library;
namespace XtmLabs.Tests
{
[TestClass]
public class WorkerTests
{
[TestMethod]
[
{
"outputFileName": "pg_/bundles/accountBundle.js",
"inputFiles": [
"pg_/js/common.js",
"pg_/js/account.js"
]
},
{
"outputFileName": "pg_/bundles/contactBundle.js",
window.addEventListener("message", receiveMessage, false);
function receiveMessage(event) {
if (event.origin !== "http://my.source.com"){
return;
}
// Kod obsługujący odebrany komunikat.
// ...
}
window.postMessage(JSON.stringify(obj), destinationUrl);
@gashupl
gashupl / DynamicsEntityActivityChecker.cs
Last active August 1, 2017 13:13
Metoda pozwalająca na sprawdzenie, czy dla encji o danej nazwie możemy dołączyć aktywności
public bool IsEntityActivitiesRelated(IOrganizationService service, string entityName)
{
var response = service.Execute(new RetrieveEntityRequest
{
EntityFilters = EntityFilters.Relationships,
LogicalName = entityName,
RetrieveAsIfPublished = true
}) as RetrieveEntityResponse;
if (response?.EntityMetadata?.OneToManyRelationships != null)