I have 5 agents that I am transferring over. 1 works, 1 works wrong and 3 of them aren’t working. They are designed to email users to notify them that something is due or overdue.
Agent 2 runs no matter what but is designed to run when the form is due for attention that day.
Agent 2
SELECT Form = “CRECORD”;
@If(NxtCal != @Today & CalDone != “”; @Return(“”);“”);
server := @Subset(@DbName; 1);
Dbname := @LeftBack(@Subset(@DbName; -1); @RightBack(@Subset(@DbName; -1); “\”)) +
“QS4PARTS.NSF”;
View := “Lookup1”;
@If(txtSiteCode = @Trim(@DbLookup(“”; server :DbName; View; “Address”; 11)); “”; @Return(“”));
REM {send the notification message};
@MailSend(CalMgr; @If(LastEditor != From;
@Trim(@Unique(From : LastEditor : Owner));
@Trim(@Unique(LastEditor : Owner))); “”; "Calibration Due. Number: " + ContNum;
“This calibration record shows that it is due for calibration. This equipment must be calibrated or taken out of service. Use the attached document link below to open and view the record.” + @NewLine + "Equipment: " + Subject + @NewLine + "Date Due: " + @Text(NxtCal) + @NewLine + @NewLine + “Regards, Calibration Management.”; “”; [IncludeDoclink]);
@Success
Agent 3, 4 and 5 don’t run at all when tested and are designed to run after the form is overdue at different time periods if i remember right. Not sure what the time periods are though.
Agent 3
SELECT Form = “CRECORD”;
REM; “if the calibration is complete, then do not run on this document”;
@If(CalDone = “”; “”; @Return(“”));
REM; “get the escalation information”;
server := @Subset(@DbName; 1);
Dbname := @LeftBack(@Subset(@DbName; -1); @RightBack(@Subset(@DbName; -1); “\”)) + “QS4PARTS.NSF”;
View := “Lookup1”;
@If(txtSiteCode = @Trim(@DbLookup(“”; server : DbName; View; “Address”; 11)); “”; @Return(“”));
edate := @TextToNumber(@DbLookup(“”; server : DbName; View; “Escalation Calibration Record”; 7));
@If(NxtCal = @Adjust(@Today; 0; 0; -edate; 0; 0; 0); “”; @Return(“”));
def := @DbLookup(“”; server : DbName; View; “Escalation Calibration Record”; 3);
escal := @DbLookup(“”; server : DbName; View; “Escalation Name”; 2);
@MailSend(def; @Trim(@Unique(CalMgr : LastEditor : Owner)); escal; "Calibration First Escalation Message Number: " + ContNum; “This calibration record shows that it is overdue for calibration. This equipment must be calibrated or taken out of service. Use the attached doc link below to open and view the record.” + @NewLine + "Equipment: " + Subject + @NewLine + "Date Due: " + @Text(NxtCal) + @NewLine + @NewLine + “Regards, Calibration Management.”; “”; [IncludeDoclink]);
@Success
Agent 4
SELECT Form = “CRECORD”;
@If(CalDone = “”; “”; @Return(“”));
server := @Subset(@DbName; 1);
Dbname := @LeftBack(@Subset(@DbName; -1); @RightBack(@Subset(@DbName; -1); “\”)) +
“QS4PARTS.NSF”;
View := “Lookup1”;
@If(txtSiteCode = @Trim(@DbLookup(“”; server : DbName; View; “Address”; 11)); “”; @Return(“”));
edate := @TextToNumber(@DbLookup(“”; server : DbName; View; “Escalation Calibration Record”; 8));
@If(NxtCal = @Adjust(@Today; 0; 0; -edate; 0; 0; 0); “”; @Return(“”));
def := @DbLookup(“”; server : DbName; View; “Escalation Calibration Record”; 3);
def1 := @DbLookup(“”; server : DbName; View; “Escalation Calibration Record”; 4);
escal :=@DbLookup(“”; server : DbName; View; “Escalation Name”; 2);
@MailSend(def1; @Trim(@Unique(def : CalMgr : LastEditor : Owner)); escal; "Calibration Second Escalation Message. Number: " + ContNum; “This calibration record shows that it is overdue for calibration. This equipment must be calibrated or taken out of service. Use the attached doc link below to open and view the record.” + @NewLine + "Equipment: " + Subject + @NewLine + "Date Due: " + @Text(NxtCal) + @NewLine + @NewLine + “Regards, Calibration Management.”; “”; [IncludeDoclink]);
@Success
Agent 5
SELECT Form = “CRECORD”;
@If(CalDone = “”; “”; @Return(“”));
server := @Subset(@DbName; 1);
Dbname := @LeftBack(@Subset(@DbName; -1); @RightBack(@Subset(@DbName; -1); “\”)) +
“QS4PARTS.NSF”;
View := “Lookup1”;
@If(txtSiteCode = @Trim(@DbLookup(“”; server : DbName; View; “Address”; 11)); “”; @Return(“”));
edate := @TextToNumber(@DbLookup(“”; server : DbName; View; “Escalation Calibration Record”; 9));
@If(NxtCal = @Adjust(@Today; 0; 0; -edate; 0; 0; 0); “”; @Return(“”));
def := @DbLookup(“”; server : DbName; View; “Escalation Calibration Record”; 3);
def1 := @DbLookup(“”; server : DbName; View; “Escalation Calibration Record”; 4);
def2 := @DbLookup(“”; server : DbName; View; “Escalation Calibration Record”; 5);
escal :=@DbLookup(“”; server : DbName; View; “Escalation Name”; 2);
@MailSend(def2; @Trim(@Unique(def1 : def : CalMgr : LastEditor : Owner)); escal; "Calibration Third Escalation Message. Number: " + ContNum; “This calibration record shows that it is overdue for calibration. This equipment must be calibrated or taken out of service. Use the attached doc link below to open and view the record.” + @NewLine + "Equipment: " + Subject + @NewLine + "Date Due: " + @Text(NxtCal) + @NewLine + @NewLine + “Regards, Calibration Management.”; “”; [IncludeDoclink]);
@Success
Any help would be appreciated