TypeError: Cannot call method "ServiceName" of null
In a Thing, Made an Service Testing2, In this calling a Service(AddAlertEntry) from DataTable, when this is executed normally/Individually works fine.
When the same service(Testing2) is called from an subscription for every 15mins gives the following error:
Error in: Test_Thing.Testing2 javascript service. Message ::TypeError: Cannot call method "AddAlertEntry" of null (Testing2#1)
AddAlertEntry Code:
logger.warn(Code+ " " + Asset+ " " + Time+ " " + Alerts+ " " + Priority+ " " + Status+ " " + AlertDuration+ " " + UserInformation+ " " + Resolved);
var values = me.CreateValues();
values.Code = Code;
values.Asset = Asset;
values.Time =Time;
values.Alerts = Alerts;
values.Priority = Priority;
values.Status = Status;
values.AlertDuration = AlertDuration;
values.UserInformation = "Shashi";
values.Resolved = me.GetMaxID()+1;
var params = {
values: values,
};
var result = Things["ActiveAlert_DataTable"].AddDataTableEntry(params);
Thanks,
Shashi

