CRM 2011 Filtering Records In The Subgrid

This filtering record in subgrid really take my time. This is what i do to filter the subgrid records. 

1. I created two entity (Properties and Project). Relation 1:N (Project : Properties). Where one Project lookup will occur in properties form design.

2. I hidden the project lookup because i wanted it to show in properties view. As i know if there are no properties field then it is impossible to show in properties view. The reason why there are project lookup is because i wanted the subgrid to filter by project lookup.

3. I created a subgrid in property and name it as SubgridProjects.

4. After finish created the form in properties with project lookup(hidden) and Subgrid of project. Its time to do some scripting then.

5. Create a new script (example: GPSB_Subgrid.js).

6. Add in script. Note: Make sure u do your changes correctly to make sure it work.


7. Go to form properties add in the script to the form and on event handlers add updateSubGrid function on OnLoad event. 

8. Last save and publish the form and entity. Below would be the screenshot taken during my progress including process to Create Subgrid, Script on Subgrid, Form Preview and Result.

Insert Subgrid Method
The form will look like this after u created the subgrid. 
Re modify the script according to what u named them. 
Form properties create script and add function to Onload Event.
My Result........
The project will be the subgrid where the record filter by one hidden project lookup value. It is disable because the subgrid act as a view to view the project record.

0 comments: