Wednesday, September 5, 2012

How to open CRM FORMS and Web Resources correctly!?


Some CRM implementations require the use of custom Jscript to pop open a new entity form window or a window displaying an existing record in CRM. Previously, there was no “supported” way to do this, since we had to use the window.open Jscript object which relies on the use of the Document Object Model (DOM).

Update rollup 8 provides new SDK functions which CRM configurators can use to open CRM forms and web resources in a nice supported way.

The Old Way - Making the URL static with parameters:
Here is an example of how to pop open an existing Account using Jscript:

function popAccount() {
var accountId = "8FB2CCE4-20E4-E111-9700-00155D042F0D";
var url = Xrm.Page.context.getServerUrl() + "/main.aspx?etn=account&id=" + accountId + "&pagetype=entityrecord";
window.open(url);
}

Here is an example of how to pop open an HTML Web Resource using Jscript:

function popHTML() {
var url = Xrm.Page.context.getServerUrl() + "//WebResources/iaf_/html/test.html";
window.open(url);
}

Although these methods do work, they could potentially break as new rollups are applied to your system, or when CRM 2011 is available on multiple browsers.

The New way - New functions :)

function popAccount() {
var accountId = "8FB2CCE4-20E4-E111-9700-00155D042F0D";
Xrm.Utility.openEntityForm("account", accountId);
}

If we wanted to pop open a new Account form, we can exclude the ID parameter.
Here is an example of how to pop open an HTML Web Resource using Jscript:

function popWebResource() {
var webResourceName = "iaf_/html/test.html";
Xrm.Utility.openWebResource(webResourceName);
}

Please note this is only a few of New functions released in rollup 8 related to "Xrm.Utility"  :)

Happy Xrm'ing!

Source: http://blogs.msdn.com/b/crm/archive/2012/07/18/new-xrm-utility-functions-in-update-rollup-8-for-microsoft-dynamics-crm-2011-and-microsoft-dynamics-crm-online.aspx

Wednesday, May 30, 2012

The view: "Products in Parent Price List" is gone!?

This article talks about a parent look view which is never visible after the “Display search box in lookup diaglog” is checked while customizing Opportunity Product Entity in CRM 2011. There is an easy workaround to get back to old view.

How do I revert to old view?

If you’re thinking that you can just go and uncheck. No then that’s not a solution. We will need to revert through a customization tweak. The reason for this and by now CRM has reset the view id. Hence it shows a different view.
The following are steps to achieve that
  1. Go to Settings > Solutions
  2. Add new Solution and provide a valid name to it.
  3. Save the solution.
  4. Now add existing entity, “Opportunity Product”
  5. Export the solution as unmanaged
  6. Open the unmanaged solution in notepad and locate the following:
  7. Replace {8BA625B2-6A2A-4735-BAB2-0C74AE8442A4} with {BCC509EE-1444-4A95-AED2-128EFD85FFD5}
  8. Save the changes
  9. Zip the files and import the solution back to your environment
  10. Publish the customizations
  11. Refresh the CRM in your browser
  12. You will see the correct view.
Tip: The GUIDS in step 7 could be found in the DB or in the URL of a "clean CRM" dialog for opportunity lookup

Happy XRM'ing!

Friday, April 13, 2012

CRM2011 Setup and Upgrade Errors With Resolutions

When upgrading from CRM 4.0 to MS CRM 2011 you might bump into serveral issues, I've listed some of the most normal serarios :)

"Fragmented indexes were detected in the Microsoft Dynamics CRM database",
This might accure during the import of the organizations:

Resolution:
Re-index the organisation databases (A SQL script)

USE MyDatabase
GO
EXEC sp_MSforeachtable @command1="print '?' DBCC DBREINDEX ('?', ' ', 80)"
GO
EXEC sp_updatestats
GO

Updating statistics ensures that queries compile with up-to-date statistics

'System.ServiceModel.Channels.ReceivedFault' in Assembly 'System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b73a53451934e545' is not marked as serializable
Error when testing Email router:

Resolution:
Add the account running the email router services to PrivUserGroup security group.

SQLSERVERAGENT (SQLSERVERAGENT) service is not running on the server ......


Resolution:
· Check if SQLSERVERAGENT service is running
· Open the port 445 for SQL Server


Microsoft.Crm.Web.Reporting.SrsReportViewer.SetExecutionCredentials(ServerReport reportObj) Cannot create a connection to data source 'MSCRM'. (rsErrorOpeningConnection)
The error message gets received when accessing the reports from any of the organizations:

Resolution:
· Add SSRS service account to privreporting group.
· Reinstall the reporting extension again using deployment account.

The process to resolve was as follows:

1. Uninstall the Reporting Extensions.
2. Go to the CONFIG DB (MSCRM_CONFIG) of CRM and update your organization's row in the Organization table to set the AreReportsPublished boolean field to FALSE.
3. Re-install the Reporting Extensions and they should publish the reports again.

Note: You will see the message about installation is republishing the reports again

Unknown labels in settings group

Resolution:
Follow the Microsoft article for resolution: http://support.microsoft.com/kb/2530358.

Happy XRM'ing!