Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9013389
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T03:15:14+00:00 2026-06-16T03:15:14+00:00

I am working on a customisation for CRM 2011. I have created a custom

  • 0

I am working on a customisation for CRM 2011. I have created a custom entity (which is based on activity so is an activity type aswell), created the relationship to account and on the account form created a custom navigation link pointing to a web resource which will power the custom display (this is just a html page with JavaScript).

The Web resource is used instead of a standard relationship link because it is doing a listings and preview display and not just the list view that the out of the box feature provides.

What i am trying to do is show the activities tab (the activities ribbon tab) on the accounts form, whenever the custom navigation link is pressed and a user goes into that section, in the same way it displays when you click the activities navigation link. I can’t seem to find that much information on Tab Display Rules as i think that is the place (if this is possible) that it should be done.

Also, if there is a JavaScript way of doing it (although i have not found any) then that would work as well.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T03:15:16+00:00Added an answer on June 16, 2026 at 3:15 am

    We have a solution.

    DISCLAIMER This solution is not recommended (or supported) as it is a complete hack of epic proportions, but it solved the issue for us. this is a temporary bit of functionality as we build out a custom solution which will better fit the client, so it will not be there moving forwards which is why the hack worked for us. Additionally, a scripts could be written much better, we simply wanted to get it out the door.

    NOTE: This solution will use some external libraries such as JQuery & CRM FetchKit

    1) Adding a relationship to the custom object and account
    We have a custom entity, and we created a 1:N relationship from the Account entity to our custom entity. What this does enables us to do is create a navigation link on the account form which points to an associated view of our custom entity. Once the link is in, we save and publish changes.

    2) Get the id of the new navigation link created
    The link above should now be on the form, so after saving and publishing we go to the live view and using the IE developer tools we get the id of the link as we need to catch the onclick and do some things with it later.

    3) Decorating the onclick of the navigation link created
    We have the id so and we want to decorate the onclick with some additional functionality. We create 2 new web resources:

    • “YourCustomEntity”_init : Javascript Web Resource: this will be used in the onload of the account form to get the link we created and alter the onclick to do some additional things
    • YourCustomEntity_page : HTML Page Web Resource: As per the original question, we have a additional requirement of showing a preview pane which is why we couldn’t use the standard grid

    Code for “YourCustomEntity”_init
    Code is pretty basic and doesn’t have any object caching or the like it was simply written to solve our problem. I have added comments to the code. Also Entity is a generic name, this was the name of our custom type. We set the original associated view to hidden instead of display:none because we still need it to load in the background as this is where the ribbon gets updated and loads, so there is definitely some script going on to do this, wish we knew it so we could just use that 🙂

    function previewEntityInit(){
        //Catch any navigation link click, we need this because we need to hide our 
        //grid when we are not on the custom entity page
        $('.ms-crm-Nav-Subarea-Link, .ms-crm-FormSelector-SubItem').click(function () {
    
        //Get the id of the link clicked and the frame injected object
        var id = $(this).attr('id'),
            cFrame = $('#entity_frame_preview');
    
        //if the frame has already been injected
        if(cFrame.length !== 0) {
            //If we are not in the correct section 
            //(i.e. activities nav link was clicked) hide it 
            if (id !== 'nav_new_account_new_entity') {
                cFrame.attr('style', 'display:none;');
            }
            else{
                //The correct link was clicked, so show it
                cFrame.attr('style', 'display:block; width:100%; height:100%;');
                $('#new_account_new_entityFrame').attr('style', 'visibility: hidden;');
            }
        }
        else{
           //This is the first time the correct link has been clicked
           //So we hide the default associated view and inject our
           //own iframe point to the YourCustomEntity_page embedded resource we created
           var src = Xrm.Page.context.getServerUrl();
            if (id === 'nav_new_account_new_entity') {
               $('#new_account_new_entityFrame').attr('style', 'visibility: hidden;');
    
              $('<iframe />', {
                    id: 'entity_frame_preview',
                    src: src + '/WebResources/new_entity_page',
                    width: '100%',
                    height: '100%'
                }).prependTo('#tdAreas');
            }
        }
    });
    

    YourCustomEntity_page
    Not going to show all the code here, but we based ours on this link:

    Preview Form Link
    We changed it in the following ways:

    • Only the view name is hardcodes, the rest is taken via code (code below)
    • We don’t use the second iframe opting instead to have a simple HTML section which loaded this (code for this and our load function below)

    No Hard Coded Values

    var server = Xrm.Page.context.getServerUrl();             
    var orgName = "";
    
    // grid related settings
    var entityId = window.parent.Xrm.Page.data.entity.getId();
    var entityType = "1";
    var areaView = "new_account_new_entity"; 
    var internalGridElement = "crmGrid_new_account_new_entity";
    var timeoutKey = null;
    

    HTML For Preview

    <div id="previewForm" style="display: none;">
        <ol>
            <li><span class="lbl">Account:</span><span id="lblAccount"></span></li>
            <li><span class="lbl">Created:</span><span id="lblDate"></span></li>
            <li><span class="lbl">Regarding:</span><span id="lblRegarding"></span></li>
            <li><span class="lbl">Owner:</span><span id="lblOwner"></span></li>
        </ol>
        <div id="subject">
           <span class="lbl">Subject:</span><span id="lblSubject" class="value"></span>
        </div>
        <div>
           <span id="lblMsg"></span>
        </div>
    </div>
    

    LoadPreview Code

    This uses an external library called CRMFetchKit. The code actually does three fetch calls, this is not ideal and it should be one really (using joins, google it :)), but this wasn’t working and was dragging so we decided just to go with three as this whole section will be replaced with a managed solution soon.

    function LoadPreviewPane(entity) {
                if (entity != null) {
                    $('#previewForm').show();
    
                    var fetchxml = ['<fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="false">',
                                    '  <entity name="new_entity">',
                                            '<attribute name="subject" />',
                                            '<attribute name="description" />',
                                            '<attribute name="createdon" />',
                                            '<attribute name="new_account" />',
                                            '<attribute name="ownerid" />',
                                    '    <filter type="and">',
                                    '      <condition attribute="activityid" operator="eq" value="' + entity.Id + '" />',
                                    '    </filter>',
                                    '  </entity>',
                                    '</fetch>'].join('');
    
                    CrmFetchKit.Fetch(fetchxml).then(function (results) {
    
                        var account = window.parent.Xrm.Page.getAttribute("name").getValue(),
                            subject = results[0].getValue('subject'),
                            desc = results[0].getValue('description'),
                            created = new Date(results[0].getValue('createdon')),
                            theDate = created.getDate() + "/" + (created.getMonth() + 1) + "/" + created.getFullYear(),
                            owner = '',
                            regarding = '';
    
                        var fetchxml2 = ['<fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="false">',
                                    '  <entity name="systemuser">',
                                            '<attribute name="fullname" />',
                                    '    <filter type="and">',
                                    '      <condition attribute="systemuserid" operator="eq" value="' + results[0].getValue('ownerid') + '" />',
                                    '    </filter>',
                                    '  </entity>',
                                    '</fetch>'].join('');
    
                        CrmFetchKit.Fetch(fetchxml2).then(function (users) {
                            owner = users[0].getValue('fullname');
                            $('#lblOwner').html(owner);
                        });
    
                        var fetchxml3 = ['<fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="false">',
                        '  <entity name="account">',
                        '<attribute name="name" />',
                        '    <filter type="and">',
                        '      <condition attribute="accountid" operator="eq" value="' + results[0].getValue('new_accountname') + '" />',
                        '    </filter>',
                        '  </entity>',
                        '</fetch>'].join('');
    
                        CrmFetchKit.Fetch(fetchxml3).then(function (regardings) {
                            regarding = regardings[0].getValue('name');
                            $('#lblRegarding').html(regarding);
                        });
    
                        $('#lblAccount').html(account);
                        $('#lblSubject').html(subject);
                        $('#lblMsg').html(nl2br(desc));
                        $('#lblDate').html(theDate);                        
    
                    });
                }
            }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am working with a Wpf application. I have created a custom style for
I have been working on some customisation for SharePoint 2010 using Visual Studio. My
Has anyone managed to get a custom IMessageInterpolator working to enable customisation of error
I am working on some CRM 2011 Online customisations and I need to get
I am working on a split-view based application for the iPad. I created a
I'm working on a Django project, and I've created some custom admin views using
Working with Reporting Services 2008 r2. So here's my issue: We have 5 reports
I am working on a design where I can have flexible attributes for users
I have page for which I want to load different template file for different
I am working on opensource project. As of of now I don't have any

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.