Pages

Thursday 15 November 2012

Calcluating sub grid items on close of child crm2011 form

If you want to update field of parent form based on the subgrid item without refreshing or save parent form
you can follow these steps .

1. Attach close event  to the load event of child form
function on_childform()
{
 window.attachEvent ("onunload", ParentFormFieldUpdate);
}
2. Retrieve gird elements by  SOAP  method (this  i will explain on my next blog)

3. Perform action on the ParentFormFieldUpdate()
.function ParentFormFieldUpdate()
{
//Retreieve by soap Method .
//perform action on the retrieved data  //put condition regarding of parent enitty id.
//then  updated parent from field by

window.parent.opener.Xrm.Page.getAttribute("linu_totalaveragegrossdiscount").setValue(totalgrossdiscount);


}

This will update parent form field by closing child form .

You can easly avoid unwanted button on CRM form.



1 comment:

  1. Thank you amazing code .. only the hours difference should be converted to string !

    ReplyDelete