My CRM For:

SOLVED

I've added a new tab to the User menu to display a custom dot net list page. The list needs to be sensitive to the user selected in the My CRM For: drop-down list displayed by CRM. Unfortunately, when I choose a different user from the list, instead of re-displaying my custom list page, it displays the dashboard screen instead.

Is there a work-around for this?

Thanks

  • 0

    Paul

    I am going to make the assumption that your user's default 'Log me In to' screen is the Interactive Dashboard. I think you will find that if this is changed to Opportunity List then you will find you are redirected to that page. (In my system my 'Log me In to' was the Opportunity List).

    The custom list page in the My CRM context will have a URL that looks like

    localhost/.../Do

    When the selected user is changed you then click the little arrow to the right of the name of the person displayed in at 'My CRM for:'.

    This when pressed executes some JavaScript.

    javascript:{ document.getElementById('SELECTUser').onchange();}

    This then triggers off the redirect.

    Within the HTML of the page the element that has the name 'SelectUser' looks like

    SELECT class=TOPSELECTUSER size=1 name="SELECTUser" id="SELECTUser" onChange="

    if(SELECTUser.options == null || SELECTUser.options.length == 0) {thevalue=1;} else {thevalue=SELECTUser.options[SELECTUser.selectedIndex].value;}

    SageCRM.webMenu.MyCRMSelectedUserID=thevalue;

    document.location= '/crm/eware.dll/Do?SID=172340166226901&Act=164&Mode=5&CLk=T&Key0=4&Key4='+thevalue;"

    And will result in a URL that looks like

    localhost/.../Do

    You can see that 'Act=164' (which is for the Opportunity List) has been inherited from the User preferences. The variable 'thevalue' is the ID of the user that you selected.

    If you have Interactive Dashboard as your 'Log me in to' screen then the system action will be Act=6001.

    This is a bug within the .NET ListPage class as it renders the SELECTUser field in the My CRM context.

  • 0

    hi Jeff

    Thanks for the info. I've written the following work-around which fixes the url in the "My CRM for:" selection onchange handler. It may be of use to others:

    public override void BuildContents()

    {

    string prms = "&Act=432";

    prms += "&dotnetdll=" + ThisDotNetDll;

    prms += "&dotnetfunc=" + ThisDotNetFunction;

    prms += "&J=" + Dispatch.QueryField("J");

    prms += "&T=" + Dispatch.QueryField("T");

    AddHeaderContent(@"");

    //...

    //... other code

    //...

    base.BuildContents();

    }

    paul

  • 0

    Paul

    Superb. And this is now a logged bug and has been escalated internally.

  • +1 in reply to Paul C
    verified answer

    It appears that that code snippet didn't make it intact from the old CRM community site.  It should be:

            public override void BuildContents()

            {

                string prms = "&Act=432";

                prms += "&dotnetdll=" + ThisDotNetDll;

                prms += "&dotnetfunc=" + ThisDotNetFunction;

                prms += "&J=" + Dispatch.QueryField("J");

                prms += "&T=" + Dispatch.QueryField("T");

                AddHeaderContent(@"<script>$(function(){$('#SELECTUser').attr('onchange',function(){return $(this).attr('onchange').replace(/&Act=\d*/,'" + prms + "')})})</script>");

                //...

                //... other code

                //...

                base.BuildContents();

            }