Welcome to our website

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. ed ut perspiciatis unde omnis iste.

Posts mit dem Label CRM 4.0 Troubleshooting werden angezeigt. Alle Posts anzeigen
Posts mit dem Label CRM 4.0 Troubleshooting werden angezeigt. Alle Posts anzeigen

Donnerstag, 1. März 2012

Dynamics CRM 4.0 - Error Showing Related Money field in a Dynamics CRM 4.0 View

Dynamics CRM 4.0 - Error Showing Related Money field in a Dynamics CRM 4.0 View

One of our clients recently came across an error when navigating to a customized view in Microsoft Dynamics CRM 4.0. Basically, a CRM user was trying to add a money field of a related entity as a column of the view. After publishing the changes to the entity, the user navigated to the view in CRM only to receive the generic An Error has Occurred dialog.
Error Showing Related Money field in a Dynamics CRM 4.0 View
This type of error message doesn’t give us much information at all, but there are some debugging techniques we can use to track down the error. Firstly, we need to see which field on the view is causing the error. We have two fields from related entity on the view – one money field, and one lookup field. We can try to remove the lookup field and publish the view to see if this prevents the error from being displayed. As expected, the error no longer shows up so we can conclude that the money field is causing the issue.
Next, we can check the Event Viewer on the CRM server assuming we have administrator privileges and we are using an on-premise implementation. We want to choose the Windows Logs -> Application to identify any errors with CRM.
Error Showing Related Money field in a Dynamics CRM 4.0 View
We can see that the Event Viewer is definitely picking up an error of some sort, but there’s not a lot of information. It appears that a plugin registered on the Retrieve Multiple message has failed so for starters we can check any plugins we have developed registered on this message. Unfortunately for us, there were no plugins registered on this message with the affected entity, but we decided to disable all plugins just in case. However, this made no difference as the error was still being displayed but we can rule out that a plugin is causing the error.
Money fields in CRM are stored in multiple columns. We have the money field itself, as well as a value in the base currency. It could be possible that the two fields to not match, thus an error is being thrown by the CRM platform when trying to retrieve them. We can run a simple SQL script inside SQL Server Management Studio to see if this is the case.
Error Showing Related Money field in a Dynamics CRM 4.0 View
The results show that the money field and its corresponding base value are identical, so we can also rule this out as a possible cause for the error. Finally, we can turn on tracing on the CRM server to give us information on all actions being performed by the CRM platform. To turn on tracing, you need to run the Microsoft CRM Diagnostics tool for CRM 4.0.
Error Showing Related Money field in a Dynamics CRM 4.0 View
Open up the tracing file in Notepad and do a search for the schema name of the problematic field. In this case, we will search for “mag_amount1”. The trace file gives us the exact cause of the error in CRM and tells us that the “transactioncurrencyid” is missing from the view.
The reason we need to add the currency field to the view is because the entity we are working with doesn’t have a currency field since it does not have any money field defined for the entity. When we add the money field from a related entity to the view and try to display the results, CRM does not have any currency information for the field, so fails to convert the field to the right currency. For this reason, we must also include the currency field from the related entity for the view to be displayed correctly.

Displaying Money Field from Related Entity in a View Error – Need to Add Currency Field From the Related Entity to the View

Displaying Money Field from Related Entity in a View Error – Need to Add Currency Field From the Related Entity to the View

To illustrate this issue - We would like to display the "Credit Limit" from the Account’s Primary Contact in an Account View.
To prepare for this, we setup an Account’s Primary Contact "Test Contact One" with a "Credit Limit" value of "100.00":
We then created an Advanced Find on the Account entity to display both the "Credit Limit" fields (Currency and Base) of the Account’s Primary Contact:

When we run this Advanced Find on Microsoft CRM v4.0 On-Premise - we received this error:
An if we run this Advanced Find setup on Microsoft CRM Online – we didn’t get an error, but the "Credit Limit" (Currency) value is blank!

The cause of this issue was due to the "Currency" field not present in the view. Our Advanced Find views above for both Microsoft CRM v4.0 On-Premise and CRM Online are working properly after adding the "Currency" field from the Primary Contact!
 

Twitter Delicious Facebook Digg Stumbleupon Favorites More

 
Design by Free WordPress Themes | Bloggerized by Lasantha - Premium Blogger Themes | Free Samples By Mail