Saturday, March 16, 2013

Setting a Blank Default URL for an IFrame in CRM 2011

It is common that we want an IFrame in an entity form and we need the URL of the IFrame to be set dynamically when the form loads using the setSrc() method in a script. But how can we set a blank default URL?

When you insert an IFrame in a form, the form designer forces you to enter a blank URL. Before Polaris (UR12) we could enter “about:blank” and we’re all set! However, you are now forced to enter a URL with a valid prefix (http, https, ftp, fttps):

image

If your IFrame will embed external web pages (such as www.bing.com ) then it is not a problem to enter the default URL and have the script modify the URL if required at run time. However, if your IFrame is used to display HTML pages that you have defined as CRM Web Resources then you will not want to enter the full URL (e.g. http://mydevcrmserver.com/myorg/WebResources/test.html ) because the URL would contain a link to your DEV organization and that means that every time you promote to test/prod or install the solution on a different server, you’d have to go and modify the URL manually. So what can you do?

One option is to set the defaul URL to some hard-coded external website (e.g. http://www.bing.com) and have your script update the URL at runtime so the IFrame loads your HTML web resource. Ugly!

The best option would probably be that Microsoft allows as to enter “about:blank” but it seems this is no longer allowed after UR12 (hopefully they will allow it in the future). But you don’t want to rely on that.

The second best option that should work for you is to define your own “blank” web resource (Thanks to Alex Ries for the suggestion):
  1. Create a new HTML web resource, which is blank (<HTML/>)
  2. In your form, instead of inserting an IFrame, insert a web resource and use your blank web resource you just created.
  3. At run time, your script should still be able to modify the URL of your web resource to point to another web resource. The setSrc() method is supported on IFrame as well as web resource controls!


With this solution, you are no longer using an IFrame so you are not forced to set a default URL! Hope this helps you!

Sunday, March 3, 2013

CRM 2011 Workflow Utilities released for CRM Online

You might know the CRM 2011 Workflow Utilities Codeplex project. The most popular request is now available: CRM Online support.

Today I have created a new release (v2.0.2.0) which now supports installing the solution in a CRM Online organization. Workflow utilities is a CRM solution that allows you to extend the CRM workflow design experience by providing the following custom workflow steps available directly from the CRM process designer.:

  • Delete record
  • Share or “unshare” a record
  • Insert hyperlink to a CRM record
  • Qualify lead (convert to account/contact/opportunity)
  • Bulk activate / deactivate records (no record count limit)

For more details on how to install and use the solution please visit the Codeplex site. Thanks for all the feedback received, enjoy!