DataTable query not working
I keep getting a type error when trying to query a DataTable.
Please see my code below:
******************************************************
var params = {
NameOfOrgUnit: UserSelectedOrgUnit /* STRING */
};
//base type of nameOfDataTable is THINGNAME
var nameOfDataTable = me.getDataTableNameBasedOnOrgUnit(params);
var query = {
"filters": {
"fieldName": "customerName",
"type": "EQ",
"value": UserInputCustomerName //STRING
}
};
var params = {
maxItems: undefined /* NUMBER */,
values: undefined /* INFOTABLE*/,
query: query /* QUERY */,
source: undefined /* STRING */,
tags: undefined /* TAGS */
};
// result: INFOTABLE dataShape: "undefined"
var result = nameOfDataTable.QueryDataTableEntries(params);
**********************************************************
I've tried setting the output of the service DataTableNameBasedOnOrgUnit to STRING and THINGNAME; however, I keep getting a script error that says the following:
if output is STRING: "[message: Execution error in service script [checkIfCustomerNameExists] :: TypeError: Cannot find function QueryDataTableEntries in object SFG.Customer.Norway.DT. (checkIfCustomerNameExists#25)]"
if output is THINGNAME: "[message: Execution error in service script [checkIfCustomerNameExists] :: TypeError: Cannot call method "QueryDataTableEntries" of null (checkIfCustomerNameExists#25)]"

