Form Sub-Grids in MS CRM 2011

November 12, 2010 by · 2 Comments 

One of the new UI capabilities in CRM 2011 is the Sub-Grid. This powerful feature gives users with proper security the ability to view, create, and modify records for a related entity directly within a form.

image

For more details see the original post on Customer Effective

Load and refresh any associated view in MS CRM

August 3, 2010 by · 2 Comments 

Normally when you display an associated view inside an IFRAME some of MS functionality breaks e.g. the automatic refresh when you add a new record. Adi Katz has developed the N2NViewer and AssocViewer to display resp. a many-to-many or a one-to-many grid inside MS CRM. The latter apparently does not refresh activities or history because a separate MS function needed to be called.

In the function below I have combined both viewers into one and added an extra check to call the correct function to refresh activities and history as well.

Copy the following code in the form OnLoad event: Read more

Refresh associated view grid in iFrame

July 7, 2010 by · Leave a Comment 

This function can be used to programmatically refresh a grid of an associated view displayed in an iFrame without having to reload the entire form or press F5.

In this example we refresh only the grid when clicking on the tab in which the associated view resides.
Read more

Displaying inactive records in associated view

June 29, 2010 by · Leave a Comment 

There are a number of ways to display inactive records in an associated view.

MVP George Doubinski wrote an article about how to solve this by using a plugin.

MVP Ronald Lemmen had a different approach via JavaScript. Here is a copy of that post.

Step by Step

  1. Export Customizations for the specific entity
  2. Open the XML file with a text editor
  3. Look for the section ""
  4. Look for the saved query with the localized name of the associated view
  5. In that saved query look for the filter that is specified in the columnset
  6. Remove the filter
  7. Save the Customizations file
  8. Import the Customizations file
  9. Publish the Customizations

Read more

Override a button of any Associated View

June 1, 2010 by · Leave a Comment 

This post describes how you can override the function of any button (e.g. New Quote) of the associated view displayed in either the navigation pane (example 1) or in an iFrame (example 2. The function requires the following parameters:

area : name of the iFrame or area (when displayed in the NavPane e.g. areaQuotes)
button : name of the button to override (use IE Developer Toolbar to get the ID of the button)
newfunction : new function to call
   

image  

Copy the code in the Onload event and call the function using one of the examples below: 

Read more

Change the default filter of an Associated View

June 1, 2010 by · 4 Comments 

This article explains how to set a default filter on any associated view, displayed both in the navigation pane (example 1) or in an iFrame (example 2). This function requires the following parameters:

area : name of the iFrame or area (when loaded in NavPane e.g. areaContracts)
field : name of the filter field e.g. statecode or actualend
defaultValue : default value or text (e.g. 'All')
   

 image 

Statuses per entity
The following table gives an overview of the statuses per entity:

Contract
('statecode')
Cases
('statecode')  
Activities
('scheduledend')
History
('actualend')
0=Draft
2=Active
3=On Hold
4=Cancelled
5=Expired
'All'=All 
0=Active
2=Cancelled
'All'=All 
'Overdue'=Overdue
'Tomorrow'=Tomorrow
'NextXDays;7'=Next 7 days  'NextXDays;30'=Next 30 days
'NextXDays;90'=Next 90 days
'NextXMonths;6'=Next 6 months
'NextXMonths;6'=Next 6 months
'All'=All 
'Today'=Today
'LastXDays;7'=Last 7 days
'LastXDays;30'=Last 7 days
'LastXDays;90'=Last 7 days
'LastXMonths;6'=Last 6 months
'LastXMonths;12'=Last 12 months
'All'=All 
Opportunities
('statecode')   
 
Quotes
('statecode')
 
Orders
('statecode')
 
Invoices
('statecode')
 
0=Open
1=Won
2=Lost
'All'=All                
0=Draft
1=Active
2=Won
3=Closed
'All'=All               
0=Active
1=Submitted
2=Cancelled
3=Fulfilled
4=Invoiced
'All'=All 
0=Active
1=Closed
2=Paid
3=Cancelled
'All'=All 

Copy the code in the Onload event and call the function using the examples below: 

Read more

Remove 'Add Existing xxxxx to this record' button

May 17, 2009 by · Leave a Comment 

Sometimes you want to hide the 'Add Existing xxxxx to this record' button in MS CRM. Thanks to Dave Hawkes and other CRM guru’s there is a way.

Follow this link to see the original post by Dave Hawkes: http://blog.davehawes.com/post/2008/04/24/MSCRM-4-Remove-Add-Existing-xxxxx-button.aspx

After testing this script I found that it was not entirely working for Associated Views in an iFrame. In addition, the buttons kept reappearing when the form was resized.

I modified the code so that it works for Associated Views displayed both in the NavPane as well as in a iFrame.

Tip:
When multiple languages are used in your implementation you can pass the title of all appropriate languages in the title Array before calling the function e.g. var hideButtons = ["Add existing Interest to this record", "Een bestaande Interesse toevoegen aan deze record"];

Please note:
This script calls 1 additional function also posted on our blog: gLeft().

Copy the function below in the OnLoad event:

Read more

Dynamically load any entity in an iFrame

May 16, 2009 by · Leave a Comment 

There are a lot of examples on how to load associated entities in an iFrame in MS CRM. These all have in common that the entity in the associated view is directly related to the active entity, namely the entity displayed in the form.

In this article I will explain how you can load any entity in an iFrame, regardless of the entity that  is showing by passing the correct GUID.

Scenario:
In this example I want to show the active contracts of the selected customer directly on the Case form. When the user changes the customer, the appropriate (active) contracts are displayed.

Step-by-Step:
First we need to determine the exact URL of the entity we want to display.

  • Open a record of the entity in question and press F11.
  • Look for the part between "…/sfa/" and "/areas.aspx?id=…” For example: accts = accounts and conts = contacts.

Next we need to determine the area which we need to load. For system entities this always starts with “area”. For custom entities it is the name of the 1-N relationship. In this example we want to load contracts, thus the area we need to call is areaContracts.

Finally, we need to retrieve the correct GUID of the customer lookup. See this post on how to retrieve a value from a lookup: gLookupGetValue().

Here’s the complete code, including additional instructions: Read more

Dynamically load an associated entity in an iFrame

May 2, 2009 by · 3 Comments 

Always wondered how to load an associated entity in an iFrame in MS CRM? Here's how:

  1. Add an iFrame to the form
  2. URL = about:blank
  3. Activate the "Pass record…. " option.
  4. Deactivate all other options.

Copy the following code in the form OnLoad event: Read more