Saturday, July 31, 2010

Categories

Minimize

Archive

Minimize

Tag Cloud

Minimize

Altriva Team Blog

Minimize

The Power of IFrames: Presenting External Data, Stock Price Graph Example

Posted by: Phil Edry on 10/16/2009
  • Categories:
  • CRM

IFrames are a powerful extension tool within Microsoft Dynamics CRM 4.0. In addition to allowing you to host custom websites, IFrames allow you to present relevant data from external websites within the context of an open entity. As a quick example, this blog post will show how to present historical information regarding a company’s stock price from within an account form. I hope this example will inspire you to find many other ways to present relevant data to users through the use of IFrames.
 

Let’s jump straight into implementing this solution. When we’re done, we’ll have a new tab that has an IFrame reference to Google Finance search on the company’s ticker symbol, or if that isn’t provided, then the company’s name.

 Step 1: Add a new tab to the account entity.

In the CRM web client, navigate to Customize Entities >> Account >> Forms and Views >> Form and click Add a Tab. Name the tab as you see fit – we’ll call it “Finance”.

Step 2: Add a Section to the new tab with the default options and then add an IFrame with the following pictured settings entered.

 

Step 3: Add JavaScript

While still on the form, navigate to Form Properties >> OnLoad. Merge the following code into any existing code in the OnLoad event. Be sure to check the “Event is Enabled” check box if it is not already checked.

var sUrl = "about:blank";
 
if (crmForm.all.tickersymbol.DataValue != null && crmForm.all.tickersymbol.DataValue != "")
{
    sUrl= "http://www.google.com/finance?q=" + crmForm.all.tickersymbol.DataValue;
}
else if (crmForm.all.name.DataValue != null && crmForm.all.name.DataValue != "")
{
    sUrl= "http://www.google.com/finance?q=" + crmForm.all.name.DataValue;
}
crmForm.all.IFRAME_finance.src = sUrl;

 
It is a good idea to check for crmForm.FormType to ensure the code only fires when you expect it to, but this is optional. Another optional step would be to add this code to the OnChange event for the Ticker Symbol and Name fields. Also, you could hide the Finance tab whenever the Ticker Symbol field is empty, but note that hiding tabs is technically unsupported in CRM 4.0.
 

Step 4: Publish
 

Save and close the form and then click publish.

Conclusion

That’s it! Now users can get a quick view of the financials for a given company just by switching to the Financials tab. This piece of functionality demoed above is just a taste of what can be done with IFrames. In fact, this functionality is pretty redundant, since users can simple double click the Ticker Symbol on a form and get similar data from MSN Money. The only thing this piece of functionality that this specific customization provides is the ability to search on a company that doesn’t have the Ticker Symbol field filled out, since it uses the name instead. A couple of quick JavaScript changes, and you could easily modify this example to display driving directions from your main office to an account’s primary address using Bing or Google Maps. It is small improvements like these that can give an added boost your customer adoption campaign.
 

Create a trackback from your own site.

0 Comments

Leave A Comment



Please enter the CAPTCHA phrase above.



  
  

Recent Comments

Minimize

"Hi Lee -- I would just create one-off workflows for each user in your system in that case. Or, create a number of sync users for yourself, and then bulk edit those sync users to another record." Read more
by Phil Edry on Allow Multiple Users to Sync the Same Contact to Outlook Effortlessly with Microsoft CRM

"Norbert and Jeff -- CRM Online couldn't support this exact setup due to current limitations with plug-ins. However, a different integration could be developed that would work with Online and BPOS. If you'd like additional information, please feel free to email info@altriva.com." Read more
by Phil Edry on CRM to SharePoint Site Creation and Clients List Integration

"great article thanks Would the CRM security model be adhered to by the calendar? I have 30 business units in CRM and want a shared calendar at the BU level but for users to only see the records from thier BU and not the whole system. Would be nice not to have to build multiple calendars?" Read more
by Jeff Murtari on Adding a Custom Calendar to the CRM UI

"I also have the same question as Norbert. I'm very interested in this if you're able to do this with CRM Online. " Read more
by Jeff Snyder on CRM to SharePoint Site Creation and Clients List Integration

"Would i be able to do this with the online versions of CRM and BPOS? " Read more
by Norbert on CRM to SharePoint Site Creation and Clients List Integration

"Thanks guys this has solved a major hurdle for us. I may be missing something obvious here but is it possible to modify the workflow, so that "Sync User" can be selected as we have a situtation where the PA would like to set the 'Sync User' for multiple contacts as their manager." Read more
by Lee Southam on Allow Multiple Users to Sync the Same Contact to Outlook Effortlessly with Microsoft CRM

"Good example... event more flexible then CRM Customization Manager" Read more
by Peter Olsson on Export CRM customizations using PowerShell

"Thanks! I encountered this same error, so this was helpful. It would be nice to know what attributes are causing the problem. I heard that some rollups actually changed the size of some attributes. I'm not sure how that would be related to CRM Online or if it could be impacted by the date the organization started using CRM." Read more
by Gretchen Mann on Importing Customizations from one CRM Online Instance to Another CRM Online Instance

  
Copyright 2010 by Altriva LLC