Community Tip - Visit the PTCooler (the community lounge) to get to know your fellow community members and check out some of Dale's Friday Humor posts! X
hey there,
I want to retrieve the value history of all the properties, but in the application log I get following error:
[context: com.thingworx.webservices.context.HttpExecutionContext@6cea85f4][message: Execution error in service script [AC_helper getACContaminationHistory] : TypeError: Cannot call method "QueryPropertyHistory" of null (getACContaminationHistory#17)]
This is what my function "getACContaminationHIstory" looks like: (the output is an infotable(with all of my properties the thing has) and the input is a string (ACtag)
var params = {
identifier: ACtag /* STRING */
};
// result: THINGNAME
var thingname = Resources["EntityServices"].GetThingNameForIdentifier(params);
var params1 = {
oldestFirst: true /* BOOLEAN */,
maxItems: 1000 /* NUMBER */,
endDate: undefined /* DATETIME */,
query: undefined /* QUERY */,
startDate: undefined /* DATETIME */
};
// result: INFOTABLE
var result = Things[thingname].QueryPropertyHistory(params1);
Any suggestions? Thank you in advance!
Theresa
Hi Theresa, sorry for the basic question, does the variable thingname gets it's required value? May be have that surrounded with try/catch block to check?
Hey Sushant Pandey,
the variable thingname is definitely getting the right value. I have already tested the function with a valid thingname input and what I am getting is
a empty result table:
Do you set your property's "Aspects" parameter in "logged"?