Posts

Showing posts with the label JavaScript Function

How to Query Entity in Dynamics CRM Portal - AdxStudio(Using Odata method and Liquid Template Method)

There are bascially 2 ways we can query entity in CRM Customer portal: Method 1: Via Liquid Template Method 2: Via Odata In this blog I am going to show how we can query crm entity using above 2 methods one by one. Mthod 1: Using Liquid Template Follow the below steps for creating code: Step1 : Create a new Web Template where you'll have to add your fetch xml code. [? A Web Template includes the actual coded design on the record itself.  Because of this, the code can be accessed from the UI or even programmatically via SDK or API.] A liquid code contains below tags: Tags – Liquid tags are the programming logic that tells templates what to do. Tags are wrapped in: {% %} characters.   Some tags can take parameters.  Examples: if unless else elsif case and or for cycle tablerow include assign increment. Objects – Liquid objects contain attributes to output dynamic content on the page. For example, the page object contains an attribute called title that ca...

How to bind Dynamics CRM data to dropdown using JavaScript/ HTML?

Image
In this blog, I 'll show how we can create a dropdown and bind it with value from Entity record values e.g we need to show all On-Demand process inside an entity as a dropdown list. So for this I have used 2 methods: ODATA and WebAPI call.. For Users using older version of CRM can use ODATA method. In this below example I am binding all system view in the dropdown inside an HTML web resource. Copy and paste code as below: 1. ODATA Method: <head>     <script type="text/javascript" src="/_common/ClientGlobalContext.js.aspx"></script> </head> <body style="overflow-wrap: break-word; height: 24px; word-wrap: break-word;">     <select id="viewdropdown" onchange="GetSelectedviewValue(this)" style="height:24px; width:495px; margin-left:16px">         <option selected="" value="Loading...">Loading...</option>     </select>     <script> ...

How to Write a Plugin when a Case is resolved with use Email Template in C#

In this blog, I am going to explain how we can fire a plugin on Resolved Case. Additionally I have added methods which shows how we can use Email Template too. Follwing points is important when working on resolved case plugin: 1. To fire a plugin when an incident is resolved we need to register the plugin in "Close" message for the incident entity. 2. In Input parameters of the context we need to check for IncidentResolution (this entity holds information of case being closed). Put below codes inside your Plugin, In my sample code I am creating an email activity after case gets resolved.         public class IncidentPostCloseHandler : IPlugin         {             public void Execute(IServiceProvider serviceProvider)             {                 try                 {       ...

Validate Input Phone Number in Microsoft Dynamics CRM using JavaScript

Sometime we get requirement to validate a phone number like to check only numeric value allowed with all round bracket and '+' sign etc in the number. So below is a basic JavaScript fucntion which validates a phone number like: (022)6655-7878 or +91-7878787878 or +44-6756-6767-4234 and so on function CheckPhoneNoFormat(context) {     var oField = context.getEventSource().getValue();     if (typeof (oField) != "undefined" && oField != null) {         try {             var telnum = oField;             // Convert into a string and check that we were provided with something             var telnum = telnum + " ";             if (telnum.length == 1) {                 telNumberErrorNo = 1;                 return false    ...

How to show enlarge image when mouse hover on image or link in Asp.Net(c#) using JavaScript

Image
In this blog i am going to show we could show enlarded image when hover on Link or an image like we see on any e-commerce website. First of all right click on your application >> Select Add New Folder and Give name as images >> Once folder created place some images in folder to show preview of images when hover on link using JQuery in asp.net. After completion of folder creation and insertion of images in folder write the following code in your aspx page :: Put the below code inside the <heaD> tag::  <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"> </script> <script type="text/javascript" language="javascript">     $(document).ready(function () {         ShowPreview();     });     // Configuration of the x and y offsets     function ShowPreview() {      ...

Code for designing and developing a very famous game- Tic Tac Toe or say Simply Cross- zero game with the help of JavaScript

Image
In this blog i am going to share a very interesting thing. Yes, you are right i am going to show you how we could make a game very easily with the help of JavaScript.                                All of us have heard about this game and in our childhood days almost almost all of us had played Tic-Tac-Toe game or in simple words Cross-zero game. But now we'll play it on our PC and that too developed by ourselves. So you seems excited to develop it. You don't require to take any stress just copy and paste the whole code and start playing... :) First of all copy paste the whole JavaScript code inside the <head> tag given below :: <script type="text/javascript">     //Simple Tic Tac Toe Game:     //board is a 3 by 3, two dimensional array of numbers. board = new Array(new Array(0, 0, 0), new Array(0, 0, 0), new Array(0, 0, 0)) //integer points/values i...

Code for showing Attractive Validation hints and Alert Message using JavaScript

Image
In this blog i am going to show how to alert users with message in a very attractive way while entering values in textbox areas (i.e. Validation Hint) and how to get values from HTML controls and show those values in alert message through JavaScript.       Validation Hints is a simple script that aides in form validation. It makes sure that password and username fields are the specified length, and can even validate against regular expressions. Small and handy. First of add all the functions and the CSS code given below inside the <head> tag ::   <style type="text/css"> form { width:500px; border:1px solid #ccc; } fieldset { border:0; padding:10px; margin:10px; position:relative; } label { display:block; font:normal 12px/17px verdana; } input {width:160px;} span.hint { font:normal 11px/14px verdana; background:#eee url(images/bg-span-hint-gray.gif) no-repeat top left; color:#444; border:1px solid #888; padding:5px 5px 5px 40p...
go to top image