Microsoft Dynamics CRM 2011 – Hide Areas of a Form

// Toggle the Ribbon Toolbar to Show/Hide (same as clicking the show/hide Ribbon button) window.top.document.getElementById("minimizeribbon").fireEvent("onclick"); // Hide the Ribbon Toolbar and move the form Content area to the top of the window. window.top.document.getElementById("crmTopBar").style.display = "none"; window.top.document.getElementById("crmContentPanel").style.top = "0px"; // Move Form Content area up to top of window, initial style.top is 135px // Hide Left …

Get the CRM server url from Silverlight [If the silverlight page is in a form]

private static String GetServerUrlFromCrmContext() { try { // If the Silverlight is in a form, this will get the server url ScriptObject xrm = (ScriptObject)HtmlPage.Window.GetProperty("Xrm"); if (xrm != null) { ScriptObject page = (ScriptObject)xrm.GetProperty("Page"); ScriptObject pageContext = (ScriptObject)page.GetProperty("context"); String serverUrl = (String)pageContext.Invoke("getServerUrl"); return serverUrl; } else { goto DevUrl; } } catch { goto DevUrl; …

Adding a custom button to CRM 2011 Form

Adding a button to a CRM Form is quite challenging as we don't have any IDE to design it. But still it's possible using JavaScript.Here's the JavaScript code for that.// Create the button, using the new_custombutton field as a container        CreateButtonCRM5('swpmt_cancelddi', 'Cancel DDI', '75 px', '16_cancel.png', CustomClickFunction);// Custom Functionfunction CustomClickFunction() {    var response …