Adding a report link to the Common Tasks pane in Infor CRM (formerly Saleslogix)

 When you are viewing an Entity Detail page, the Common Tasks pane on the right of the page provides a number of links to perform common tasks, such as Mail Merges, Emails and creating activities for the current entity record.  By making a couple modifications, we can add a link to run a report from this section

 I’m going to demonstrate how to add a report link to the Account Entity.  Account should already have a link to run the Account Detail report, but we will add a new report link to show how this can be done for other entities as well.

 There are three files that we are going to modify.  In Application Archatect,  under the Portal Manager; look under SalesLogix Client->Support Files->SmartParts->TaskPane->CommonTasks.  We will be modifying the files; CommonTasksTasklet.ascx, CommonTasksTasklet.ascx.cs, and CommonTasksTasklet.ascx.resx under the App_LocalResources folder.

CommonTasksTasklet.ascx

 In the ascx file, we will create a simple Javascript function to run the Report file.  We’ll be running the standard Account Summary report.  Since this report is based off of the Account entity, and we will be running it from the entity page, Infor CRM will handle restricting the report to the current account record.  We will want to add this function to the Javascript section, which you can find by searching for the term <script type=”text/javascript”>. (probably around line 34).  Add the function to the end of this section.

function RunAccountSummaryReport(){

                        var oReporting = Sage.Services.getService(‘ReportingService’);
                        oReporting.showReportByName(‘Account:Account Summary – Sample’);
                        return false;
            }

 CommonTasksTasklet.ascx.cs

In the CS file, we will be defining the actual link that shows up in the Common Tasks pane.  Look for the function named FillDetailPageDictionaries in this file.  Within this function, there should be a section for each main entity. 

        string[,] accountDetailTasks =
            {{“tskDetailReport”,”TaskText_DetailReport”,”javascript:commonTaskActions.showDetailReport();”,”false”},
             {“tskEmail”,”TaskText_Email”,”javascript:commonTaskActions.emailSend();”,”false”},
            {“tskMailMerge”,”TaskText_MailMerge”,”javascript:ExecuteWriteAction(WriteAction.waWriteMailMerge, null);”,”false”},
             {“tskAddToGroup”, “TaskText_AddToGroup”,”javascript:commonTaskActions.showAdHocList(event);”, “false”},
             {“tskRemoveFromGroup”,”TaskText_Remove”,”javascript:commonTaskActions.removeCurrentFromGroup();”,”false”},
             {“tskAddResponse”,”TaskText_ResponseToCampaign”,””,”false”},
             {“tskInsertNote”,”TaskText_AddNote”,”javascript:Sage.Link.newNote();”,”false”},
             {“tskNewMeeting”,”TaskText_Meeting”,”javascript:Sage.Link.scheduleActivity(‘Meeting’);”,”false”},
             {“tskNewPhoneCall”,”TaskText_PhoneCall”,”javascript:Sage.Link.scheduleActivity(‘PhoneCall’);”,”false”},
             {“tskNewToDo”,”TaskText_ToDo”,”javascript:Sage.Link.scheduleActivity(‘ToDo’);”,”false”}};
        tasksByEntity.Add(“IAccount”, accountDetailTasks);

We will add a new line to this section, creating our link to the Javascript function we just created.

        string[,] accountDetailTasks =
            {{“tskDetailReport”,”TaskText_DetailReport”,”javascript:commonTaskActions.showDetailReport();”,”false”},
             {“tskEmail”,”TaskText_Email”,”javascript:commonTaskActions.emailSend();”,”false”},
            {“tskMailMerge”,”TaskText_MailMerge”,”javascript:ExecuteWriteAction(WriteAction.waWriteMailMerge, null);”,”false”},
             {“tskAddToGroup”, “TaskText_AddToGroup”,”javascript:commonTaskActions.showAdHocList(event);”, “false”},
             {“tskRemoveFromGroup”,”TaskText_Remove”,”javascript:commonTaskActions.removeCurrentFromGroup();”,”false”},
             {“tskAddResponse”,”TaskText_ResponseToCampaign”,””,”false”},
             {“tskInsertNote”,”TaskText_AddNote”,”javascript:Sage.Link.newNote();”,”false”},
             {“tskNewMeeting”,”TaskText_Meeting”,”javascript:Sage.Link.scheduleActivity(‘Meeting’);”,”false”},
             {“tskNewPhoneCall”,”TaskText_PhoneCall”,”javascript:Sage.Link.scheduleActivity(‘PhoneCall’);”,”false”},
             {“tskNewToDo”,”TaskText_ToDo”,”javascript:Sage.Link.scheduleActivity(‘ToDo’);”,”false”},
             {“tskRunReport”,”TaskText_RunReport”,”javascript:RunAccountSummaryReport();”,”false”}};
        tasksByEntity.Add(“IAccount”, accountDetailTasks);

CommonTasksTasklet.asxc.resx

Finally, we need to modify the resx file.  This file defines display properties for the various links found in each entities task pane, so we will need to define the text for the link here.  You can add this after the other data tags.

  <data name=”TaskText_RunReport” xml:space=”preserve”>
    <value>Account Summary Report</value>
  </data>

 

And that is all there is to it.  After a build/deploy of the changes, you should now see a link displaying “Account Summary Report” on the Account detail common tasks pane.

Thanks for reading!

 

ABOUT THE AUTHOR

Jason Buss

Jason is a senior application developer with Customer FX.

Submit a Comment

Your email address will not be published. Required fields are marked *

Subscribe To Our Newsletter

Join our mailing list to receive the latest Infor CRM (Saleslogix) news and product updates!

You have Successfully Subscribed!