web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

CRM 2015 (Online) Update 1 breaks JavaScript for changing initial view and filter for Associated views

(0) ShareShare
ReportReport
Posted on by

Hello,

The associated views always show up with the same default view and filter (for activities) and the only method I am aware of to change this is with the use of unsupported JavaScript. Here is a link to an example

http://www.magnetismsolutions.com/blog/paul-nieuwelaars-blog/2013/01/11/default-activity-filter-on-to-all-dynamics-crm-2011-ur12

With Update 1 for CRM 2015, this JavaScript will break and I am working with someone where this is a big deal to them. Is there another way of changing what view and filter show up when going to the Associated Views?

There is a twist to this. On one of the forms that uses the JavaScript there are 3 subgrids for activities. Depending on which subgrid you navigate from, a different view in the associated activities is wanted.
 Because of this, any code will need to identify which which subgrid button was clicked and what view should be shown.

I have looked into a Retrieve Multiple plugin, and I don't think this will work since it would not be able to distinguish what view is needed.

I have never seen a supported solution to this either and looking at the additions for Update done, still do not see a supported option.

*This post is locked for comments

I have the same question (0)
  • Verified answer
    ScottDurow Profile Picture
    21 on at

    There is no supported way to do this but if you want to get you code working - replace any references to document with parent.window.document since the turbo forms now run in an iframe.

  • Community Member Profile Picture
    on at

    I have tried this out and ran into a problem

    parent.window.document.getElementById is a valid function, but when it doesn't find the subgrid element I am looking for.

    The original is - document.getElementById("Activities_openAssociatedGridViewImageButton")

    The updated is - parent.window.document.getElementById("Activities_openAssociatedGridViewImageButton") and returns null.

    One difficulty I have is that I learned JavaScript with CRM, so I DOM usage isn't a strong point.

  • Victor Crespo Profile Picture
    on at

    Hello

    It seems like an issue with the new render in CRM 2015 Update 1 since you are using Js and DOM entity.

    Please review this link to found the custom code validation tool that might help you:

    blogs.msdn.com/.../microsoft-dynamics-crm-online-2015-update-1-new-form-rendering-engine.aspx

    Thank you for using Microsoft Dynamics Communities

    Victor Crespo

    Support Engineer | Dynamics CRM Online Support

  • Community Member Profile Picture
    on at

    I completely agree that this is due to the changes in the form render. I have tested that using the option to stick with the original form rendering will work, but that is only temporary.

    Also, the custom code validation tool did not call out this JavaScript, or at least not for the getElementById.

    I had to double check the documentation and test in a trial CRM online instance to confirm this would bring up the JavaScript error mentioned in the "What users will notice" section of the page you provided a link for.

    I know this is an unsupported customization to begin with, but is there anything similar to what Scott suggested that would allow this to work in CRM 2015 Update 1?

    Is there a different solution that allows a different views and filters to be selected when navigating to the associated records view?

  • Community Member Profile Picture
    on at

    spent some more time testing this and Scott's suggestion did work.

  • daw Profile Picture
    5 on at

    Would you please post the solution

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans