Recently we had a client ask for a 1 stop shop view of their Accounts with the ability to instantly add new Activities on the Account form. The Form Assistant already provides this but not by default. So to provide the functionality they needed, we just enabled the Form Assistant to always show (through form customizations) and added the following javascript to the onload of the form.
//Only use on the edit form
if (crmForm.FormType == 2)
{
//Set the dropdown to Follow Up
document.getElementById("followup_context").selected = true;
//Call the onchange event of the dropdown
RelatedInformationPane.LoadContextData();
}
That's it for part one.
The last thing we needed to do was show all of the open Activities on the General page as well. That was as simple as adding an iframe and building a Url to point to the Activities;
//Only use on the edit form
if (crmForm.FormType == 2)
{
//Set the dropdown to Follow Up
document.getElementById("followup_context").selected = true;
//Call the onchange event of the dropdown
RelatedInformationPane.LoadContextData();
//Get the current Account's Id
var objectId = crmForm.ObjectId;
//Get the Security Token
var securityId = crmFormSubmit.crmFormSubmitSecurity.value;
//Load the iframe
document.getElementById("IFRAME_Activities").src = "/sfa/accts/areas.aspx?oId="
+ objectId + "&oType=1&security="+ securityId +"&tabSet=areaActivities";
}
And here is the final output:

Special thanks to one of our developer's, Richard Alvarez, for coming up with the idea to display the Activities in the iframe view.
This posting is provided "AS IS" with no warranties, and confers no rights.