Writing Scripts for SubGrids with CRM 2015 Update 1

crmcooking

With the release of CRM 2015 Update 1 we can write supported scripts to get information from the subgrids.

Before CRM Online 2015 Update 1 the only unique method for the subgrid control was refresh.

As an Xrm.Page.ui control, GridControl also has all the standard control methods: getControlType, Label methods, getParent,Visible methods, setFocus, and Notification methods as well as refresh

OnLoad event

Add event handlers to this event to run every time the subgrid refreshes. This includes when users sort the values by clicking the column headings. Use the GridControl.addOnLoad and GridControl.removeOnLoad methods to manage event handlers, usually in the form Onload event.

Example :

Xrm.Page.getControl("Contacts").addOnLoad(<functionname>);

getEntityName

Use this method to get the logical name of the entity data displayed in the grid.

getGrid

Use this method to get access to the Grid available in the GridControl.

getViewSelector

Returns the

View original post 203 more words

Author: Nishant Rana

I love working in and sharing everything about Microsoft.NET technology !

Share your thoughts

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s