CRM 2011 JavaScript: Those Windows

by Jeff N. 1. July 2011 11:17

 

In CRM Javascript Development you may run into the case where you have to close an entity record window when you attempt  to open it and only want a record to be created or viewed when certain conditions are met.  A good example of this is when you close a form when it is not opened from a related entity form. The way to do this has changed slightly from CRM 4 to a new similar method in CRM 2011. Let’s look at the method in CRM 4: 

window.open()
window.close()

So these methods worked in CRM 4 since the popup window was your main window. However this Is not the case in CRM 2011. In CRM 2011 notice that the new interface is made up of different IFrames instead of one window due to the ribbon.

Therefore in order to close the correct window we must change out code a little bit to have our close method to control the correct window.  We can do this by specifying the correct IFrame to close by using the following methods:

Parent.window.open()
Parent.window.close()

 

Tags:

Categories: Dynamics CRM | CRM 5.0

Comments are closed

Month List