CRM 2011 Multiple Subgrids

We have noticed when there are four or more subgrids on a single form in Dynamics CRM 2011, not all of the subgrids will load the data, forcing users to click a link to access the data within the subgrids.

How can data be automatically loaded into all of the subgrids when a user loads a record?
rdracer58Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

LucasMS Dynamics DeveloperCommented:
Which form / entity? Are there any silverlight plugins as the sub grids?

0
rdracer58Author Commented:
We have the same situation (four or more subgrids) on multiple custom entities and their corresponding forms. And no, we are no using any silverlight plugins as the sub grids.
0
Chinmay PatelChief Technical NinjaCommented:
Hi Lukas and rdracer58,

I have a workaround that might come really handy to you guys, I was facing the same situation as you guys, hope this one will help you.
http://www.crmxpress.net/blog/post/2011/10/06/CRM-2011-Multiple-Sub-Grid-OnLoad-Fix.aspx

Regards,
Chinmay.

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

rdracer58Author Commented:
Hi Cinmay,

Do you perchance have another link? That one seems to be broken.

Thanks!

rdracer58
0
Chinmay PatelChief Technical NinjaCommented:
Hi rdracer58,

This is strange, my blogpost was deleted :[.

Anyways by chance I kept that window open so just re-created my original post by copy-paste. Try the link and it should work.

I have attached the code for your reference here.
function CrmXpress.Scripts.UI.SubGridLoadFix() { 
  
    $(document).ready(function () { 
  
        var links = $("a.ms-crm-List-LoadOnDemand") 
        for (i = 0; i <= links.length; i++) { 
            try { 
                links[i].click(); 
            } 
            catch (e) { 
                // Handle for other errors, or safely ignore 
            } 
        } 
    } 
); 
}

Open in new window


Regards,
Chinmay.
0
rdracer58Author Commented:
Excellent, thanks! I noticed on your blog entry that the JQuery minified library must be added. As I am new to scripting in CRM, where/how does this get added?
0
Chinmay PatelChief Technical NinjaCommented:
You will have to add it as a Web Resource on the form where you want to execute the script.

Here is a link that might help you.
http://community.dynamics.com/product/crm/crmtechnical/b/crminogic/archive/2011/03/08/use-of-web-resources-in-crm-2011.aspx

Add minified jQuery as one web resource and my script as a seperate resource. After that you can call : CrmXpress.Scripts.UI.SubGridLoadFix function on the OnLoad event of your form.

Regards,
Chinmay.
0
rdracer58Author Commented:
Great, thanks! To help clarify and ensure I understand correctly, each time I want to add scripting functionality to a form in CRM, I have to (1) add any applicable libraries as a web resource, (2) add the script itself as a web resource, and then (3) reference the appropriate function in the event (OnLoad, OnSave, etc.)?

Also, are there any good resources online that explain CRM scripting/coding/development in general? Any good books and other materials you would recommend?
0
Chinmay PatelChief Technical NinjaCommented:
No. Only in this case we have to do so 'cause my script is using features from jQuery. Otherwise only script that you need should be added. As such jQuery is something you will use a LOT if you want to simplify CRM Scripting.

Also you can skip adding a function if you have written your script to execute without a function. I just want to keep things organized that's why I have kept a function. There are no such fixed rules when it comes to development, just best practices.

I would strongly recommend CRM SDK : http://www.experts-exchange.com/Microsoft/Applications/Microsoft_Dynamics/Q_27377023.html to start with. Once you have basic understanding you can move towards advanced books.

Regards,
Chinmay.
0
Chinmay PatelChief Technical NinjaCommented:
Hi rdracer58,

Can you tell me why my answer was not accepted?
And in my previous post I sent you a different link by mistake. Correct link for SDK is : http://www.microsoft.com/download/en/details.aspx?id=24004

Regards,
Chinmay.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Dynamics

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.