Skip to content

Instantly share code, notes, and snippets.

View temmyraharjo's full-sized avatar

Temmy Wahyu Raharjo temmyraharjo

View GitHub Profile
@temmyraharjo
temmyraharjo / Entities.cs
Created July 3, 2021 11:20
Dynamics CRM Azure Redis Cache Demonstration for Power Maverick
using Microsoft.Xrm.Sdk;
using System;
namespace Demo.Entities
{
[System.Runtime.Serialization.DataContractAttribute]
[Microsoft.Xrm.Sdk.Client.EntityLogicalNameAttribute("account")]
public class Account : Entity
{
public const string EntityLogicalName = "account";
function getIdentityById (identityId) {
var key = 'identity' + identityId;
var fnSearch = function () {
var fetchXml = '<?xml version="1.0"?>' +
'<fetch distinct="false" mapping="logical" output-format="xml-platform" version="1.0">' +
'<entity name="new_identity">' +
'<attribute name="new_identityid"/>' +
'<attribute name="new_name"/>' +
'<attribute name="new_profile" />' +
'<attribute name="new_membership" />' +
function getOrSetCache (key, functionObject) {
var item = sessionStorage.getItem(key);
if (item) {
var objItem = JSON.parse(item);
return objItem;
}
var result = functionObject();
var stringifyResult = JSON.stringify(result);
sessionStorage.setItem(key, stringifyResult);
@temmyraharjo
temmyraharjo / _manifest.ajaxmin.xml
Created July 25, 2018 07:50
Merging Configuration File
<?xml version="1.0" encoding="utf-8" ?>
<root>
<arguments config="Debug">-ignore:ALL -debug –pponly</arguments>
<arguments config="Release"></arguments>
<output path="your-javascript-file-name1.js">
<input path="..\Namespace.Base.js"/>
<input path="_namespace.js"/>
<input path="Data.js"/>
<input path="Business.js"/>
@temmyraharjo
temmyraharjo / ajax-min.targets
Last active July 25, 2018 07:25
Js Merging From Visual Studio
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<UsingTask AssemblyFile="..\..\Libs\AjaxMinTask.dll" TaskName="AjaxMin" />
<UsingTask AssemblyFile="..\..\Libs\AjaxMinTask.dll" TaskName="AjaxMinBundleTask" />
<UsingTask AssemblyFile="..\..\Libs\AjaxMinTask.dll" TaskName="AjaxMinManifestTask" />
<UsingTask AssemblyFile="..\..\Libs\AjaxMinTask.dll" TaskName="AjaxMinManifestCleanTask" />
<ItemGroup>
<AjaxMinManifests Include="**/*.ajaxmin.xml" />