Error in: Message ::Unable To Convert From org.mozilla.javascript.UniqueTag to INFOTABLE
I am writing a custom service to a Data Table to update the data table with the count and summation data from another data table.
Input to the service is an infotable DowntimeData which is the infotable from QueryDataTableEntries service of another data table and below is the javascript code. When executed the Error message as in the subject is displayed.
// result: INFOTABLE dataShape: ""
var Category = Things["DowntimeCategoryDataTable"].GetDataTableEntries();
for(index = 0; index < Category.rows.length; index++) {
DowntimeCategory = Category.rows[index].DowntimeCategory;
// Provide your filter using the format as described in the help topic "Query Parameter for Query Services"
let query = {
"filters": {
"type": "EQ",
"fieldName": "DowntimeCategory",
"value": DowntimeCategory
}
};
var params = {
t: DowntimeData /* INFOTABLE */,
query: query
};
var result1 = Resources["InfoTableFunctions"].Query(params);
DowntimeCount = result1.rows.length;
DowntimeDuration = 0;
for(x = 0; x < result1.rows.length; x++) {
DowntimeDuration = DowntimeDuration + result1.rows[x].DowntimeDuration;
}
// DowntimeParetoTrial entry object
var newEntry = new Object ();
newEntry.DowntimeCategory = DowntimeCategory; // STRING [Primary Key]
newEntry.DowntimeCount = DowntimeCount; // INTEGER
newEntry.DowntimeDuration = DowntimeDuration; // NUMBER
// CreateInfoTableFromDataShape(infoTableName:STRING("InfoTable"), dataShapeName:STRING):INFOTABLE(DowntimeParetoTrial)
let result = Resources["InfoTableFunctions"].CreateInfoTableFromDataShape({
infoTableName: "InfoTable",
dataShapeName: "DowntimeParetoTrial"
});
result.AddRow(newEntry);
}
