Multi-Select Picklist control for Dynamics CRM by XrmForYou.com

Very happy new year to all of my blog readers. This is my first post of the year and it could not have started in a better way. I am delighted to announce the new “Multi-Select Picklist control” from XrmForYou.com tools library. Showing a picklist attribute as multi-select is a requirement we get every now […]

via {New Utility} Multi-Select Picklist control for Dynamics CRM — Debajit’s Dynamic CRM Blog

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

In my previous posts we had discussed about how we can connect Dynamics CRM with Power Bi and Power Query. But with the introduction of API in CRM 2016, there is slight change in the OData feed URL generated for CRM 2016.

Using the same process mentioned in older posts but making use of this new OData feed URL, we can achieve same results for CRM 2016 as well.

The url format is [Your Organization Root URL]/XRMServices/2011/OrganizationData.svc.

e.g.: https://u———–y.api.crm5.dynamics.com/XRMServices/2011/OrganizationData.svc

OnLoad event for SubGrid in CRM 2015 Update 1

Till CRM 2011 we used to use Xrm.page.getControl(“grid”) to get a grid control available on form and perform any runtime activity like changing the view/query, etc. Also we were required to write the complete script on OnLoad even of form and add a timeout till the subgrid is loaded as subgrids are loaded asynchronously after the form is loaded. There was no way we can have a trigger on load of a subgrid till CRM 2015 Update 1. What we used to do is explained in older post here.

But with CRM 2015 update 1, we now have an option to execute scripts when data is loaded in subgrids. Because of which we are not required to have any timeout added in the script and iterate it till the data is loaded into subgrid.

With addition on GridControl.addOnLoad method, we can now add event handler for OnLoad event of subgrid which is more reliable than the form OnLoad event for form with a timeout. This event will get triggered whenever data is bound to a subgrid.

The steps to add this event is not similar to adding a form OnLoad event (from form customization popup), the way to add it is by invoking it using a code from other events (e.g. form OnLoad) by making use of GridControl.addOnLoad method. Similarly, use GridControl.removeOnLoad to remove event handlers.

Xrm.Page.getControl(“Contacts”).addOnLoad(myContactsGridOnloadFunction);

References:

https://msdn.microsoft.com/en-us/library/dn932137.aspx?f=255&MSPPError=-2147217396

https://msdn.microsoft.com/en-us/library/dn932126.aspx#BKMK_subgridAddOnLoad

https://crmcooking.wordpress.com/2015/07/15/writing-scripts-for-subgrids-with-crm-2015-update-1/

Solution Segmentation in CRM 2016: Add selected entity assets to solution

With the launch of Microsoft Dynamics CRM 2016, out of many important features added one is Solution Segmentation and Patches.

With solution segmentation we can now export solutions with selected entity assets (fields, forms, views, etc.) rather than entire entities with all the assets.

This helps a lot as previously if we were required to deploy a single new view created for an entity, we were required to deploy and publish the complete entity. This used to end up deploying some under development depended components too. The feature is most importantly useful in applying patches.

This feature allows granular control of the solution package without changing any XML. This will make ALM and Deployments much smoother.

Also by making use of the API aspect, we can try to automate build and deployment process.

Supported entity assets that can be selected for a entity are:

  1. Forms
  2. Views
  3. Charts
  4. Fields
  5. Keys
  6. Relationships (1:N, N:1, N:N)
  7. Messages
  8. Business Rules
  9. Hierarchy Settings
  10. Dashboards

Follow TechNet articles for more information on Use segmented solutions and patches to simplify solution updates

DID YOU KNOW? What happens to Audit History on performing database level update?

062915_1445_DIDYOUKNOWW1.jpg

Note: This is all about UNSUPPORTED database level updates. These kind of updates are not recommended (unless you are left with no options).

Though any kind of database level updates are not recommended in CRM, there are scenarios where we are required to do so. I had one such requirement where I was required to perform a simple update (setting two options field value to Yes) for millions of records. Doing same using a supportive way (bulk update or bulk workflow execution) used to take days due to CRM service calls but same updates using SQL script was done in few hours.

I had auditing enabled for these records in CRM, but as this was unsupported db level update I was not expecting any help from audit history. What was expected form auditing was either of below:

  1. Change track as new update request in audit history. (If there is any kind of trigger return at db level to maintain auditing)
  2. No updates at all in audit history. (Assuming auditing are maintained by some kind of workflow/plugin that trigger at UI level)

Unfortunately, none of this happened and what happened was not at all audit friendly or expected. This is what happened:

The change made by SQL script was tracked at create event itself in audit history. But only the field value change was tracked and not the change date/time. The change date/time was still showing when the record was created.

Though these kind of changes are not recommended, but I still feel that in some cases these are required and this behavior of auditing will affect the consistency. I feel that things should be either completely baked or not baked at all than having them half baked. But again this is only what I feel. J

Example:

  1. I created a Contact record on 7/6/2015 at 11:52 AM with ‘First R~~~~~ Created’ set to ‘No’. Audit history shows something like below.

     

  2. Now on 7/6/2015 at 12:00 Noon, I update the value for ‘First R~~~~~ created’ to ‘Yes’ using a database level update script. Ideally there should have been a new entry made in audit log to track this change and there should be no change made to existing audit history records. But CRM updates the changed value in create event itself without even tracking the change time.

 

Hope this helps and thanks if you have come all the way down here reading the article.

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.

Microsoft Dynamics CRM Online 2015 Update 1 (7.1.0) Product Documentation is Available!

***[Referencing to Microsoft Dynamics CRM Team Blog]

Check out the new documentation for Microsoft Dynamics CRM Online 2015 Update 1 (7.1.0).

What’s new in this update

Everything you need to learn about – and prepare for – the new features is on these pages:

Information for IT pros, administrators, implementers, and customizers

For CRM administrators and customizers, this update includes:

Information for developers

For developers this update includes:

All new code samples for this update are available on MSDN Developer code samples:

We are in the process of migrating our codes samples out of the downloadable SDK package and make them available online so that they can be discovered more easily.

Finally, please visit the new responsive Microsoft Dynamics CRM Developer center at http://crmdevelopercenter.com/. Be sure to try the new search, which is filtered to return only MSDN library content from the Microsoft CRM SDK

Information for end-users

www.CRMhelpandtraining.com

For end-users, this update includes new topics and updates to the Training & Adoption Kit.

  • New Mobile User’s Guide –  Find out how to install the new phone app, work offline, and manage your leads through the sales process

  • Updated Training & Adoption Kit! The popular, easy-to-customize PowerPoint source files are right here – all ready for you to use for your own training, presentations, and webinars.

Enjoy the new features!

We hope this new content gets you going on all the new features of this online update.

As always, you can find your way to all documentation by visiting the central portal for all the CRM content sites: the CRM Help Center.

Let us know in the blog comments what you think of the new content – of if there’s something else you need. Give feedback to the Documentation Team at any time.

http://blogs.msdn.com/b/crm/archive/2015/05/01/product-documentation-for-microsoft-dynamics-crm-online-2015-update-1-7-1-0-is-available.aspx

 

Use Upsert to insert or update a record

You can reduce the complexity involved with data integration scenarios by using the UpsertRequest message. When loading data into Microsoft Dynamics CRM from an external system, for example in a bulk data integration scenario, you may not know if a record already exists in CRM. In such cases you will not know if you should call an UpdateRequest or a CreateRequestoperation. This results in your querying for the record first to determine if it exists before performing the appropriate operation. You can now reduce this complexity and load data into CRM much more efficiently using the new UpsertRequest (Update or Insert) message. This topic discusses how to use UpsertRequest and the process that unfolds when an UpsertRequest is received.

For Microsoft Dynamics CRM Online organizations, this feature is available only if your organization has updated to Dynamics CRM Online 2015 Update 1. This feature is not available for Dynamics CRM (on-premises).

**This topic is pre-release documentation and is subject to change in future releases.

https://msdn.microsoft.com/en-us/library/dn932135.aspx