A Pen by Ashish Vishwakarma on CodePen.
AngularJS lets you easily do a instant search if you say save your data as JSON. The elegant way that it is coded and the performance I find great. The JSON data I use, I have collected from Danish streaming TV service YouBio. I use bootstrap 3 to control the markup/layout.
Forked from Sten Hougaard's Pen AngularJS ng-repeat with search.
A Pen by Ashish Vishwakarma on CodePen.
A Pen by Ashish Vishwakarma on CodePen.
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
<b>1. Use Fail-Safe </b> | |
<br/> Using more replace() in chain than expected occurrences, this will not harm in anyway but it is not a good practice if because no. of occurrence is not predictable | |
<br/> | |
<b>Output : </b> | |
<div id="UseFailSafe"></div> | |
<br/> | |
<hr/> | |
<b>2. split() join() combination</b> | |
<br/> This approach will work for any number of occurrences, but more performance costly |
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
// https://www.ashishvishwakarma.com/set-lookup-view-with-javascript-dynamics-crm-365/ | |
function formOnLoad() { | |
setLookupViewByName("parentaccountid", "Customers", true); | |
} | |
function setLookupViewByName(fieldName, viewName, asynchronous) { | |
var req = new XMLHttpRequest(); | |
req.open("GET", Xrm.Page.context.getClientUrl() + "/api/data/v8.2/savedqueries?$select=savedqueryid&$filter=name eq '" + viewName + "'", asynchronous); | |
req.setRequestHeader("OData-MaxVersion", "4.0"); |
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
// https://stackoverflow.com/questions/1879395/how-do-i-generate-a-stream-from-a-string | |
public static Stream GenerateStreamFromString(string s) | |
{ | |
MemoryStream stream = new MemoryStream(); | |
StreamWriter writer = new StreamWriter(stream); | |
writer.Write(s); | |
writer.Flush(); | |
stream.Position = 0; | |
return stream; | |
} |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Execute fetchXML with WebAPI in Dynamics 365 using JavaScript</title> | |
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/milligram/1.3.0/milligram.min.css" integrity="sha256-Ro/wP8uUi8LR71kwIdilf78atpu8bTEwrK5ZotZo+Zc=" crossorigin="anonymous" /> | |
<style> button { width:100% } </style> | |
</head> | |
<body> | |
<h1>Testing : Execute fetchXML with WebAPI in Dynamics 365 using JavaScript</h1> | |
<button onclick="GetXHR()" id="GetXHR">Test using GET with XMLHttpRequest</button> |
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
Xrm.WebApi.retrieveRecord( | |
"msdyncrm_customerjourney", | |
"945a02a0-b2db-e811-a967-000d3af29269", | |
"$select=msdyncrm_workflowdefinition").then( | |
function (result) { | |
debugger; | |
console.log(result); | |
var workflowdefinition = JSON.parse(result.msdyncrm_workflowdefinition); | |
// Retrieve nodes related to provided component. |
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
/// Required-Namespaces | |
using Microsoft.IdentityModel.Clients.ActiveDirectory; | |
using System.Threading.Tasks; | |
/// Method-to-generate-Access-Token | |
public static async Task<string> AccessTokenGenerator() | |
{ | |
string clientId = "Azure AD App Id"; | |
string clientSecret = "Client Secret Generated for App"; | |
string authority = "https://login.microsoftonline.com/< your app tenant guid >"; |
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
{ | |
"[email protected]": "/contacts(<regarding contact record guid>)", | |
"subject": "Email Subject", | |
"description": "Email Description", | |
"email_activity_parties": [ | |
{ | |
"[email protected]": "/systemusers(<from system user record guid>)", | |
"participationtypemask": 1 | |
}, | |
{ |
OlderNewer