Archive

Archive for August 13, 2011

Submit disabled field using Jscript in CRM 2011

Hi,

Below is the syntax to submit the disabled field value using JScript.

Xrm.Page.getAttribute(“{fld_id}”).setValue(“{fld_value}”);

Xrm.Page.getAttribute(“{fld_id}”).setSubmitMode(“always”)

Hope it helps 🙂

Sub Grid Refresh Event – CRM 2011

August 13, 2011 3 comments

Hi,

Sometimes we may need to refresh Parent form, when we Add/Remove records from sub grid (i.e., On Subgrid Refresh). We can achieve this with below steps

Grid Refresh Event

  • Get the “subgrid” id (i.e., Name of the subgrid, we can get it from either ‘Form customization’ or using IE Developer Tool)
  • In parent form, onload() function attach ‘onrefresh’ event to “Subgrid”

 function Form_onload() {
//Set Action on subgrid Refresh
var subGrid = document.getElementById(“{Subgrid ID}“);
if (subGrid) {
subGrid.attachEvent(“onrefresh“,fnGridRefresh);

}

}

//This function fires on subgrid refresh

function fnGridRefresh(){

alert(“Grid refreshed!!!!”);

}

Hope it helps 🙂