Home > CRM 2011, Scripting, Web Resource > Showing related information in a CRM 2011 form

Showing related information in a CRM 2011 form

With CRM 2011 on the verge of being released there are new features being introduced that will allow you to show  1:N related records in a Sub Grid but there is still a limitation of showing information that is from a N:1 (lookup) relationship. 

Using some other new features of CRM 2011 I’ve created a Web Resource that will allow you to show related information from a lookup field. 

This Web Resource is a custom html page that pulls information from a specified lookup and queries CRM, using the new REST endpoint,  for the related data and displays it in a simple format.

Here is what it looks like loaded into the form.  This example shows information being pulled for the Primary Contact on the Account form.

 

image

 

The Web Resource pulls the GUID and Record Type from the Primary Contact Field and using the Field parameters specified on the Web Resource, queries for the contact information and displays it inline.

 

Here is how to set it up. 

 

1. Download the Solution file ***HERE***

2. Import the Solution File.  After the import you should have a new solution  called “Related Information”

                  image

3. Open the Solution to verify you have 3 new Web Resources.

                   image

4. Open up the entity form that you want to add the Web Resource to.  Example: Account Form (Tip: You can now open an entity record, click the “customize” tab at the top and then click the “Form” button to open up the designer)

5. Either highlight an existing section or create a new section to add your Web Resource to.

6. Once a section is highlighted, click the “Insert” tab at the top and then click the “Web Resource” button on the ribbon.

        imageimage

7. In the Web Resource field, select the related.html WR that was added.

8. Enter a name into the “Name” and “Label” field.

9. Enter the parameter string in the “Custom Parameter(data)” field.

  Parameters

  • lookup – The lookup column name that you want to show related information from.  Example: primarycontactid
  • fields – Comma delimited string of columns you want to pull from the related entity. Uses Schema Name
  • labels – The labels you want to display for each field.  Has to be in the same order as the field list.

Example: lookup=primarycontactid&fields=FirstName,LastName,Telephone1,EMailAddress1&labels=First Name,Last Name,Business Phone,Email Address

                   image

10. Click Ok

11. Save the Form

12. Publish Customizations and test your form

 

Enjoy!

 

This customization is provided as-is with no warranty.

Advertisements
  1. February 12, 2011 at 10:09 am

    It seems as though this version of the software is quite user friendly. The problem I have faced in the past is hard to decipher commands and functions, I’m sure other people find the same thing

  2. May 15, 2011 at 7:56 pm

    Great post Darren. Just what I was looking for. As a newbie to CRM development, being able to build up a library of code is going to save huge amounts of time.
    Thanks Again

  3. NewUser
    August 17, 2011 at 11:46 am

    This is something we need. I’m a new to CRM. When I try to import your solution I get an error about missing web resource called new_/Scripts/FormatPhoneNumber.js. Also don’t want to bring in a new account form. Can you advise?

    • September 26, 2011 at 1:24 pm

      Yes, I need to update the solution because the account form had a format phone script also applied that wasn’t included. Either create a dummy web resource with that name or walk through the steps to rebuild with the source code provided in the download. I’ll try to get the solution updated. Sorry about that.

  4. Stephanie
    April 4, 2012 at 3:51 pm

    This is close to what I am looking for. I am trying to autofill fields in a CRM 2011 form triggered by the onChange of the selection of a custom entity related lookup record. Any advice on modifying your example to accomplish this?

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: