Filter N:N Add Existing Lookup Dynamics CRM 2016 Turbo Forms

Paul Nieuwelaar, 20 June 2016

In CRM 2016, when turbo forms are enabled, pretty much any unsupported code will break. Usually it’s easy enough to add a ‘parent.’ To the front of any unsupported code, however if you’re using the code from my blog post on how to do this in CRM 2013, there’s a few tricky things that need to be updated as well.

I’m not going to go into detail about how the code works, instead I’m just showing what the updated code should be. If you want the extra details check out the previous blog posts on how to do this for CRM 2013 and CRM 2011.

To get this working in CRM 2016 with Turbo Forms, you'll need to append all the unsupported references with 'parent.'. Also, you should change the ‘var parent’ to something else like ‘var parentObj’ so it doesn't overwrite the DOM parent.

To make this easier, I’ve declared a new crmWindow variable, which makes use of the internal method of checking if turbo forms is enabled, so this code will work in CRM 2016 whether turbo forms is enabled or not. This variable also replaces the ‘context’ variable in the old code, which was just a reference to ‘this’ (the current window).

The full updated code is below, with changes to the CRM 2013 code being highlighted:

image