Commenting out the last line of an OnChange script on the CommWebPicker screen may result in a scripting error in the Outlook plugin. This applies for both the Exchange plugin and the Outlook Lite plugin. 


Selecting a Company record when filing an email from Outlook may result in the following error message:

Script error on line 51 - ID is not defined.


In Sage CRM, the content of an OnChange script is written directly to the screen HTML. This is also the case for Custom Content scripts.

In the Outlook plugin, no newline character is written out after the Onchange script. This causes an issue with the end of the OnChange function, and the next function, which starts on the same line. The error is demonstrated as follows:

function OnChangecmli_comm_companyid(){//This is a comment in an OnChange script}function SetIDcmli_comm_companyid(ID){

If the commented-out line is the last one in the Onchange script, then the SetIDcmli_comm_companyid function will not work – the ID parameter will be undefined.


A fix for this case is included in the 7.2j patch, scheduled for release at the end of October 2015.

In earlier versions of Sage CRM, the issue can be worked around in one of two ways. The first is to ensure that the last line of the OnChange script does not contain a comment. Alternatively, using block quotes /* like these */ will prevent the issue from occuring.