DID YOU KNOW? Workflow process throws generic CRM error


Scenario

I have an OOB workflow process developed some time back and activated. Now when I try to open the process, I get generic CRM error (below image). Also the process status is changed to “Draft” automatically. There were no updates made to the process.

Cause

I have seen these issues frequently especially when working with Child Workflow Processes where I have a child workflow called from a Master workflow. If you have a Master workflow calling a child workflow and for some reason the child workflow is activated as “Process Template”, then user gets this error when they try to open the master workflow.

Conclusion

CRM throws generic exception and its status is changed to Draft if it linked/related to a “Process Template” instead of “Process”.

Note

Other common issue faced while working with workflow process is “Invalid Expression” error in “Condition Expression” step. This occurs if the field used in condition expression is either deleted from system or if Value is changed. Once you fix the field/value issue, all conditions in the process are automatically fixed.

DID YOU KNOW? Fields rarely touched in Dynamics CRM

We all know that whenever we create an entity in CRM, CRM creates few fields by default. Some of these like Owner, Owning Business Unit, Created On, Modified On, etc. are used extensively while working with Dynamics CRM. But there are some fields that we use very rarely or even never; thus we tend to forget about them. But some of these fields are really important and can save a lot custom work, it’s just that we should be aware of them.

Recently there was a question on Dynamics Community regarding use of same fields which inspired me to search for them and have it documented. Few fields can be understood from their name but some fields don’t even have proper description in CRM. For such fields, below table can help. Links against the fields has more explanation and scenarios where these can be used.

Field Name Description
CreatedBy User who created the record.
CreatedOn Date and time when the record was created.
CreatedOnBehalfBy To create records on behalf of another user.
Used for impersonation in CRM 2011
ExchangeRate When I create a record, such as an opportunity,
and use a non-base currency, such as GBP in this
hypothetical scenario, this is what happens:

  • I set the Currency field to GBP
  • I put a value in the money field, called Estimated
    Revenue
  • I save the record. During the save operation,
    the following occurs:
  • The Exchange Rate field is populated with the
    value 0.61300000000
  • The Estimated Revenue_base field is populated
    with the value from the Estimated Revenue field
    converted to its inflated USD value
  • Both of these updates occur whether the Exchange
    Rate and Estimated Revenue_base fields are exposed
    on the form or not

Afterwards, when the dollar makes that incredible comeback,
I need to update my exchange rate on the GBP currency.
I do so – it’s now 1, reflecting a 1:1 conversion rate.
What happens to my opportunity? Nothing, at least not immediately.
The Exchange Rate field on my opportunity is not automatically populated
with the new value of 1. However, as soon as I change the value of ANY money
field on the opportunity and save the form, the Exchange Rate field is updated
with the new value from the GBP currency record, and the Estimated Revenue_base
field is updated with the new converted value (and any other _base fields for other
money fields on the form – remember, there is only 1 Currency and 1 Exchange Rate field,
so these values apply to all money fields on the form). This also happens if I change the state
of the record, such as closing the Opportunity as won or lost, activating or closing a quote, etc.

http://andrewbschultz.~exchange-rate-updates/

ImportSequenceNumber The import sequence number is a whole number field. The range can be customized if needed.
The basic idea behind this field is to store the sequence number (ID) of the source record during
data import to CRM. If this field is mapped during migration package/script design,
it provides a one-to-one link between source row and destination CRM record.

 

http://www.powerobjects.com/~-number-field/

ModifiedBy User who modified the record.
ModifiedOn Date and time when the record was modified.
ModifiedOnBehalfBy To create records on behalf of another user. Used for impersonation in CRM 2011
OverriddenCreatedOn Date and time that the record was migrated.
http://www.magnetismsolutions.~_crm_2011_part_1
TimeZoneRuleVersionNumber The definition of a recurrence pattern of how local time is converted to/from Universal Coordinated Time (UTC). This includes information about Daylight Savings Time (DST) versus Standard Time. Time zone rules can change over time, thus a time zone can have multiple rules from a historic point of view, but can have only one rule that is current and in effect.

 

http://blogs.msdn.com/b/crm/archive/2008/05/14/time-zones-in-microsoft-dynamics-crm-4-0.aspx

TransactionCurrencyId Currency associated with the entity.
UTCConversionTimeZoneCode Time zone code that was in use when the record was created.
VersionNumber This column is used mainly for concurrency support. The VERSIONNUMBER field is a unique value that gets incremented as records are updated – it can be very useful.

DID YOU KNOW? Value for overriddencreatedon is swiped with createdon at database level

One of my college recently had a requirement to import few records into CRM with back dated values. Isn’t it a simple task? Just map/set the back dated value for ‘overriddencreatedon’ field while create/import of records. But has anyone checked what happens to the value for ‘createdon’ field?

All views and fields in CRM displays ‘createdon’ field and not ‘overriddencreatedon’. Thus, wherever we set value for ‘overriddencreatedon’, the value is set to ‘createdon’ field and the actual date/time when the record is created into CRM is set to ‘overriddencreatedon’.

E.g.: I’m creating a record on 2015-06-16 11:45:23.000 UTC into CRM with value for overriddencreatedon set to 2015-06-16 11:44:39.000 UTC. Upon completion, if you query the database you will see that the value what I set to overriddencreatedon is set to ‘createdon’ and the value for ‘overriddencreatedon’ is replaced with actual date/time when the record was created.

Update request at 2015-06-16 11:45:23.000 UTC:

Createdon = null

overriddencreatedon = 2015-06-16 11:44:39.000 UTC

Result:

Createdon = 2015-06-16 11:44:39.000 UTC

Overriddencreatedon = 2015-06-16 11:45:23.000 UTC

date

Note: Setting ‘overriddencreatedon’ on update of record is not supported.

Get data from Dynamics CRM 2015 to Power BI using connector

Update 20th Feb 2016: 

Connecting CRM 2016 to Power Query in Excel 2013 with updated Odata feed

Original Post:

The Microsoft Dynamics CRM content pack for Power BI Preview allows you to easily access and analyze CRM data in Power BI. The content pack uses the OData feed to create a descriptive model, with all the entities and measures needed such as Accounts, Activities, Opportunities, Product, Leads, Users and more.

After you have Power BI subscription, Click Get Data on the welcome screen.

Select Microsoft Dynamics CRM and click Connect.

Important:

Make sure your popup blocker is disabled or is set to allow popups from app.powerbi.com.

Provide the OData URL associated with your account. This will be in the form “https://mytenant.crm.dynamics.com/XRMServices/2011/OrganizationData.svc

When prompted, provide your credentials (this step might be skipped if you are already signed in with your browser). For Authentication Method, enter oAuth2 and click Sign In:

After connecting, you’ll see a dashboard customized for a Sales Manager, populated with your own data:

 

For more information, see below link. Happy analyzing the data J

https://support.powerbi.com/knowledgebase/articles/462791-microsoft-dynamics-crm

CRM 2015 Web API preview documentation

**[Original Post from Microsoft CRM Team Blog]

CRM 2015 introduced a new API for enabling creation of applications across multiple platforms.

This new Web API is available as a preview feature to Microsoft Dynamics CRM Online organizations that use Dynamics CRM Online 2015 Update 1.

To support this preview feature we have put together documentation and samples you can find at https://msdn.microsoft.com/dynamics/crm/webapipreview.

In this topic

Performance issue after upgrade to CRM 2015

While working on one upgrade project, after successfully completion of all activities there were multiple performance issues experienced. While we were trying to troubleshoot the issue, may be in wrong direction; found this great article today from Sudhir Nory which explains the root cause. This may not be the issue for all performance issue on upgrade projects but is surly helpful to know.

When a database is upgraded to SQL Server 2014 from any earlier version of SQL Server, the database retains its existing compatibility level if it is at least 100(SQL Server 2008 R2). If the compatibility-level setting is 110 or lower it uses the old query optimizer which may not be effective. We found the current compatibility level displayed in the Compatibility level list box was SQL server 2008 for the ORG_MSCRM Database SQL Server 2014 includes substantial improvements to the component that creates and optimized query plans and gets utilized only when database compatibility level is reset to 120 (SQL server 2014).

http://blogs.msdn.com/b/crminthefield/archive/2015/06/04/improve-crm-query-performance-using-compatibility-version-120-when-using-sql-2014.aspx

Top 10 Data Migration Traps

While planing for the data migration item for one of my project, found this great article by Bruce Buxton which explains top 10 data migration traps. It was good to know as prevention is always better than cure 🙂

http://www.xrmconsultancy.com/2013/10/top-10-data-migration-traps/

DID YOU KNOW? List component for SharePoint integration deprecated with CRM 2015 Update 1


[Referencing The Microsoft Dynamics CRM Blog]

The Dynamics CRM to SharePoint integration has always been a key solution to document management within CRM.  With two currently available solutions, the List Component and new server-based SharePoint integration, CRM is pleased to focus our efforts on the server-based integration.  Dynamics CRM 2015 Update 1 will deprecate the List Component as a result of SharePoint’s deprecation of the sandbox solution, a dependency of the List Component.

Customers with List Component are advised to upgrade to the server-based SharePoint integration.  With CRM 2015 Update 1, server-based integration gains hybrid support between CRM Online and SharePoint On-Prem.  In a subsequent release, CRM will support CRM On-Prem to SharePoint Online and CRM On-Prem to SharePoint On-Prem.  SharePoint Online or SharePoint Server 2013 SP1 and above is required for server-based integration.

DID YOU KNOW? You can update owner and status with a single Update request in CRM 2015 with Update 1

Before CRM 2015 Update 1 release, specialized messages were required to update certain entity attribute values. These were AssignRequest to change owner of a record, SetStateRequest to change status of a record, SetParentSystemUserRequest, etc. In this release, UpdateRequest can now be used to set these attributes.

Thus with Update 1 release following specialized message will be deprecated.

  1. AssignRequest
  2. SetStateRequest
  3. SetParentSystemUserRequest
  4. SetParentTeamRequest
  5. SetParentBusinessUnitRequest
  6. SetBusinessUnitRequest
  7. SetBusinessEquipmentRequest
  8. SetBusinessSystemUserRequest

These specialized messages will continue to work with the 2011 endpoint. However, the recommendation is to use the UpdateRequest or Update method when possible to set these attributes. The Update message simplifies the SDK API and makes it easier to code standard data integration tools used with Dynamics CRM. In addition, it is easier to code and register a plug-in to execute for a single Update message instead of multiple specialized messages. The AttributeMetadata.IsValidForUpdate property for the above listed attributes has been changed to true in this release to enable this capability.

For plug-ins, when update requests are processed that include both owner fields plus other standard fields for business owned entities, plug-ins registered for the Update message in pipeline stage 20 and/or stage 40 execute once for all non-owner fields, and then once for the owner fields.

For workflows, when update requests are processed that include both owner fields plus other standard fields, workflows registered for the Update message execute once for all non-owner fields, and then once for the owner fields. Workflows registered for the Assign message by users continue to be triggered by updates to owner fields. When update requests are processed that include both state/status fields plus other standard fields, workflows registered for the Update message execute once for all non-state/status fields, and then once for the state/status fields. Workflows registered for the Change Status step continue to be triggered by updates to state/status fields.

Invoice and Invoice Line data import in Dynamics CRM

Recently I found that many people have issues importing old Invoices either from legacy system into Dynamics CRM. This is manly in scenarios where Products are not maintained in CRM. In this case import of Invoice Line throws error as the data import template for Invoice line do not have relationship with Invoice. Below are the steps that can be followed to fix the issue.

Invoice lines is a relationship between invoice and products. Thus if you need to add invoice lines, you need to add products using the “Product.xml” template file. But in our case as we don’t maintain Products in CRM, while importing Invoice lines, add invoice number of imported invoices in CRM in a separate column and select the Product as write-in in import file.

For importing Invoice lines, you need to download the “Invoice Product.xml” template file.

All the mentioned templates can be downloaded from “templates for Data Import” in Data Management section in Settings.

  1. Export Invoice Product.xml
  2. Add Invoice Line data in the xml with below values.
    1. Set “Select Product” column value to “Write In”.
    2. Add a new column “Invoice ID” and set the value to Invoice ID field of respective Invoice.
  3. Save and import the file.

4. Import the above xml file.

5. During Import wizard, on Review Mapping Summary Page, click on Edit.

6. In Map Fields, for Invoice ID row click on the look up reference and select “Invoice ID” field and click Ok.

7. Click Next and progress with the import process.

Probably issue with many users follow is at step 7. Invoice ID field is by default map to Invoice name and Invoice GUID field.

Hope this helps!