Changing the Completion Message for Report Jobs in Infor CRM

When a user runs a report in Infor CRM, it starts a report job on the server. While this is happening, the user will see a progress dialog. When it is complete, the progress dialog changes to display the text “The job has completed successfully” and presents a link for the user to download the completed report as a PDF. This might be confusing to some users since all they know is they were running a report. They don’t know that a “job” was started and completed on the server or what that means to them. However, you can change this text to something more meaningful for the user.

First, one thing to note, this progress dialog will show for running any jobs. Not just for running a report. If it were just for reports, you could likely override the text in the Sage/Utility/nls/Jobs.js file (the text is there in root.jobCompletedSuccessfully). However, that might make things confusing for when other types of jobs complete. Instead, I’m going to subscribe to the topic of when a job is complete. I’ll check the link to see if it is a download link (which, for reports, will use Sage.Utility.File.Attachment.getAttachment) and then modify the text in the dialog for only jobs with a file to download.

This is what the out of the box dialog looks like:

The code looks like this:

require(['dojo/_base/connect', 'dojo/query', 'dojo/dom'], function(connect, query, dom) { 
    connect.subscribe('/job/execution/changed', function() { 
        var lnk = query('#progressDialogLinkDiv a').first();
        if (lnk && lnk.attr('href') && lnk.attr('href').length && lnk.attr('href')[0].indexOf('Sage.Utility.File.Attachment.getAttachment') > 0) {
            var elem = dom.byId('progressDialogMessageDiv');
            if (elem) elem.innerHTML = 'Your report has been generated. Click the link below to download the file:';
        }
    }); 
});

This code will result in the following when a report job is run:

You can add this code in a script file using my Custom Loader Module o just add it to the base.master file inside a script block.

It’s a bit hacky, but any more direct way would require replacing the _updateProgress function in the Sage.Utility.Jobs.js code. One thing to note, if you are using my FX.ReportUtilityJS code to start report jobs from client-side code, it already does have the ability built-in to override the completion text when a report is run.

ABOUT THE AUTHOR

Ryan Farley

Ryan Farley is the Director of Development for Customer FX and creator of slxdeveloper.com. He's been blogging regularly about SalesLogix, now Infor CRM, since 2001 and believes in sharing with the community. He loves C#, Javascript, web development, open source, and Linux. He also loves his hobby as an amateur filmmaker.

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!