Hello guys, Long time no talk 🙂 But don’t worry, we’re back on track, with a new team of focused authors. Soon to come: – CRM 2011 related posts (C# .NET / SDK / JavaScript) – Custom Chat Client (C# .NET sockets) Stay tuned! Cornel
Category: Web Design
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
JavaScript code reuse in CRM
In most of the cases, you don’t want to copy-paste your custom methods in your CRM events source code each time you need them. So, here’s an easy approach on javascript code reuse in CRM. First of all, make sure you have these 2 files: LargeNumber.js and StringsExtended.js located in a custom folder – named… Continue reading JavaScript code reuse in CRM
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
OnChange Event
When starting to work with CRM, one of the first things you learn is how to put some script on the onChange event. It’s easy to do this and it really works. Let’s say you want to fire that script at the first moment your page is loaded.In CRM 3.0 you could do that writing… Continue reading OnChange Event