Email BPM Data directive on SysAgentSched stopped working after recent update

Hello,
I’m currently using Kinetic 2023.2.6 SAAS. Following a recent update, the Data directive BPM on SysAgentSched has ceased functioning. I had previously configured daily notification emails and reports within these BPMs, utilizing report data generated from a BAQ.
BPM had a basic condition set up to filter the schedule number and check whether the NextRun field has been updated and which is followed by my custom code with email configuration.

Has anyone encountered a similar issue after the recent update

Thanks in Advance,
Arun

Are you using any custom code widgets or function calls? We had an issue upgrading from 10.2.700 to 2023.1 with the custom code for sending emails. It also looks like you have the schedule ID set in that condition. Is it possible your schedule IDs changed on the update? You can look at those in the System Agent module.

I do have custom code where email template is defined. Agent ID isn’t changed after the update. I tried creating new schedules and even tried clipping to another schedule where I have reports with SRRS routing. The problem seems BP directives skips the calls from this table. Also noticed that Kinetic version of data directives is not showing any ice schema tables.

Hmmm… I’m not sure where to go from there. We have ours running on the SysTask table, and they seem to work fine in Kinetic. I can share one of those if it’d be helpful?

1 Like

Also noticed that Kinetic version of data directives is not showing any ice schema tables.

Quick question - what tables are you looking for. I just did a quick spot check of my local 2023.2.5 on my box and against a 2023.2.6 government cloud environment owned by dev for testing (we are a customer too sort of :)). In both environments i can see and select ICE Tables. Are there specific ones your missing?

Just reread this. Want to confirm, I’m talking about the Schedule ID, not the Agent ID. The Schedule ID is unchanged?

Yes, Kevin, It’s schedule ID. field SysAgentSched.AgentSchedNum is unchanged after update

I was searching for Ice.SysAgentSched in the Kinetic version of BPM Datadirective. There was an additional update today, so I am rechecking now.

That would be really helpful. Could you please share one of the example, It might give me some insights on how to proceed from here. Appreciate your assistance.

First widget: Set your variable (in mine the variable name is thisBAQ) to the BAQ Name

Second widget Condition > The Custom Code condition is valid

Code in conditional:

foreach(var task in ttSysTask) {

    var taskLog = Db.SysTaskLog.FirstOrDefault( x => x.SysTaskNum == task.SysTaskNum );


    // Handle Tasks with no log (e.g. Reports)
    if ( taskLog == null ) 
        return false;


    // Task is correct Dynamic Query Export
    bool isCorrectBAQ = taskLog.MsgText.Contains( thisBAQ ); 

    // Task completed Successfully
    bool taskSuccessful = task.TaskStatus == "COMPLETE";


    // Return true in loop so all may be checked
    if ( taskSuccessful && isCorrectBAQ ) 
        return true;

}


return false;

Custom Code Widget: Set up & send email:

using ( var mailer = new Ice.Mail.SmtpMailer(this.Session) ) {


    using ( var message = new Ice.Mail.SmtpMail() ) {


        message.SetFrom("Kevin Veldman <myEmail@company.com>"); 
        message.SetTo("sendTo@company.com");

        message.SetCC( "copy1@company.com; copy2@company.com" );
        //message.SetBcc( "" );

        message.SetSubject( "BAQ Export Attached" );
        message.SetBody( "BAQ Exported to csv. Results Attached." );
        message.IsBodyHtml = false; 

        var attachments = new Dictionary <string,byte[]>();

        string fileName = "Attachment.csv";
        byte[] fileBytes = File.ReadAllBytes( @"C:\Path\To\Your\BAQ\Export.csv" );

        attachments.Add( fileName, fileBytes );

        mailer.Send( message, attachments );
    }
}
1 Like

Try just searching for SysAgentSched or AgentSched. I’m not at a system now but I don’t think the ice. is needed and I’m not sure if the zdata includes the sys part of the name.

I appreciate your assistance. I experimented with your suggested conditions and even attempted using a basic Send Email widget. Unfortunately, the method isn’t triggering as expected. I’ve submitted a support ticket and am currently awaiting their response.
I’m on Epicor version 2023.2.9, and these BPM functions were operational prior to the 2023.2.6 update. Hope it worked since you were on version 2023.1.