I have been looking at Form Scripting in CRM 2011 and it’s all change.
The first change you notice is they have added a new Web Resource area, which means that you can load a Jscript library which can be accessed by all the entities.
This means we can finally create reusable Jscript libraries. It basically works by you uploading a Jscript file (you can also load other things like gifs, html, silverlight, icons, style sheet, css etc). You can then access any of these Web Resources from any entity. The reason you can do this is because rather than place these files somewhere on the CRM server, they get loaded into the database. The other benefit of this is these files are the same for offline, in the cloud and over any servers (in a farm/load balancing way).
I have to mention at these point I didn’t find the CRM 2011 SDK very useful.
It mentions in detail the context object you can get lots of lovely entity variables from.
The Xrm.Page and it’s variable parts (collections, tabs etc)
but it didn’t have much of a Hello World example, which is slightly surprising because it is quite different in the basic setup. Well maybe it did have a basic jscript example but I couldn’t find it.
I was going to write a basic example and then I found two brilliant blog postings so I thought I will just post a link to those. I couldn’t write a better basic example so I’m not going to
I ran through these and I liked the idea of ordering the various Jscript libraries in an entity, event framework.