4 Replies Latest reply on Sep 26, 2017 6:40 AM by tlichtenberger-2 RSS
    tlichtenberger-2 Apprentice

    Cannot call method QueryPropertyHistory of null

    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!