Report query

Community Alums
Not applicable

Hi All,

 

Am getting error in the report when am trying to call script include function in the report filter, however the report is not getting generated:

Script include:

Client callable: true

function SFTP_error_records() {
    var sfpt_data_source = new GlideRecord('sys_data_source');
    sfpt_data_source.addEncodedQuery('file_retrieval_method=SFTP');
    sfpt_data_source.query();
    while (sfpt_data_source.next()) {
        var fetchdata = sfpt_data_source.name;
        var SFTPerrorRecords = [];
    var DS_SFTP_error_records = new GlideRecord('import_log');    DS_SFTP_error_records.addEncodedQuery('source=source=ScheduleImportJob^sys_created_onONYesterday@javascript:gs.beginningOfYesterday()@javascript:gs.endOfYesterday()^levelIN1^messageLIKE^sys_created_onONToday@javascript:gs.beginningOfToday()@javascript:gs.endOfToday()^levelIN1^messageLIKE'+fetchdata);
    DS_SFTP_error_records.query();
    while (DS_SFTP_error_records.next()) {
        SFTPerrorRecords.push(DS_SFTP_error_records.getValue('message'));
    }
   
    return SFTPerrorRecords;
    }
 

 Report:

Attached screenshot.

 

Note: I did tested the script in the background script, its working fine.

 

Could anyone please let me know where am going wrong.

Any help is Appreciated!!

Thanks in Advance!!

 

 

 

4 REPLIES 4

Elijah Aromola
Mega Sage

I believe javascript needs to be lowercase.

Community Alums
Not applicable

Thanks Aromola.

With lowercase also its not working.

Elijah Aromola
Mega Sage

Can you post your entire script include? The SI call needs to be:

 

javascript: new ScriptIncludeName().functionName();

Community Alums
Not applicable

Still not working Aromola!!