Continuing my iFrames series, let's take a look at reading MSCRM object attributes from an iFrame.

Download the project code here Webscratch

I suggest creating a temporary web project where you can work on projects such as th4ese. On my development server I created a directory and IIS virtual directory called "WebScratch". This app will run and display the MSCRM object info.

DON'T FORGET: if using VS 2005 you must create a separate App Pool (separate from .NET v1.1 apps) and set the ASP.NET version to 2.0.

Next, open up the project files in VS 2005, and make sure you change the web service reference to point at your CRM server instead of mine.

Next build the project and copy the files into your temporary directory. So using my development setup as an example, I copy the entire project directory to C:\Inetpub\wwwroot\webscratch

Now we need to add an iFrame to an MSCRM object to test our app.  I chose to use "Account". You can add teh iFrame anywhere you choose, however I decided to add a new Tab called "Demo", and put the iFrame there (I Assume you know how to do this!). Point the URL at your new app, and be sure to check the "Pass record object-type..." box; uncheck the "restrict cross-frame scripting" box; and on the "Formatting" tab check the "Automatically expand..." box. Click OK to close this screen.

Next Click Preview->Create Form.

Once the form is open, click the "Demo" tab and you'll see the results of our app.

So, we can see that we can read the CRM GUID for the object, and the object type. Does this get you thinking of ideas? If not, please turn your propeller cap in at the door! :)

 

What should we do next?!?