CRM 2011 – Sharing records in IFRAME

Hello, Unfortunately, if you want to use the sharing dialog in an IFrame, you’ll receive several errors (most of them regarding _a.length object). To solve the issue, you can try the following workaround. It’s not supported, but it’s safe. Still, I recommend you backup any file before modifying it. Go to %programfiles%\Microsoft Dynamics CRM\CRMWeb\_grid\cmds and… Continue reading CRM 2011 – Sharing records in IFRAME

JavaScript Serial Number Generator

To generate a random serial number, based on a given mask, you can use the following code: // Serial Number Generator // Generates a random number in a certain interval function GenerateRandomNumber(min,max) { return Math.floor(Math.random() * (max – min + 1)) + min; } // Generates a random alphanumberic character function GenerateRandomChar() { var chars… Continue reading JavaScript Serial Number Generator

Useful JavaScript functions & methods for CRM 2011 – CWS.CRM.Utils.js Library

Starting with this great article, I’ve created a JavaScript Library with several useful functions & methods for CRM 2011, such as: – CRM Service class to Create, Update, Retrieve, RetrieveMultiple, Delete records in CRM (SOAP based); – Custom Runtime Advanced Filtered Lookup support; – Set Lookup Value programmatically support – Guid Generator – CRM Form Buttons… Continue reading Useful JavaScript functions & methods for CRM 2011 – CWS.CRM.Utils.js Library

Generate a new Guid in JavaScript

As easy as that 🙂 // Generate new Guid function Hexa4() { return (((1+Math.random())*0x10000)|0).toString(16).substring(1); } function GenerateGuid() { return (Hexa4()+Hexa4()+”-“+Hexa4()+”-“+Hexa4()+”-“+Hexa4()+”-“+ Hexa4()+Hexa4()+Hexa4()).toUpperCase(); } // USE var guid = GenerateGuid(); alert(guid);

Creating records in CRM 2011 using JavaScript

Using the CRM Web Service, you can create new entity records, just using JavaScript. The following code demonstrates this: // Make Struct function MakeStruct(names) { var names = names.split(‘ ‘); var count = names.length; function constructor() { for (var i = 0; i < count; i++) { this[names[i]] = arguments[i]; } } return constructor; }… Continue reading Creating records in CRM 2011 using JavaScript

JavaScript structures

Here’s a brief example of how to create structures in JavaScript. We’ll use this function a lot from now on in our code. // Make Structfunction MakeStruct(names) { var names = names.split(‘ ‘); var count = names.length; function constructor() { for (var i = 0; i < count; i++) { this[names[i]] = arguments[i]; } }… Continue reading JavaScript structures

Published
Categorized as JavaScript

Large Integer division remainder

Recently, I had to obtain the remainder of a (seriously) large integer division (32 digits long divided by another shorter integer; base 10) and found that JavaScript reliably supports operations only on 15-digit long integers. Thus, this what I came up with: // Gets the remainder from the division operation for LARGE numbers// Support: positive… Continue reading Large Integer division remainder

Published
Categorized as JavaScript