1 Reply Latest reply on May 19, 2017 5:58 AM by tlichtenberger-2 Branched from an earlier discussion. RSS
    tlichtenberger-2 Explorer

    Unable to convert from com.thingworx.dsl.engine.adapters.VirtualFunction to Infotable

    Hey Ankit Gupta,

     

    thanks for your answer.

     

    Other question:

    I want to write an service which calls QueryPropertyHistory in order to fill a time chart.

    For that, I again use the GetThingnameForIdentifier service to find the proper thing which I want to retrieve the properties of.

    The result should be an infotable so that I can bind the chart with All Data.

    My service looks like following:

     

     

    when testing this service I get following error:

     

    Any suggestions?

     

    Thank you for helping me out!

    Theresa ~

     

    Message was edited by: Sushant Pandey branched from https://community.thingworx.com/thread/41652?sr=inbox&ru=13444

      • Re: Unable to convert from com.thingworx.dsl.engine.adapters.VirtualFunction to Infotable
        Ankit Gupta Ninja

        Correct way is:

         

        var params = {
            identifier: Id /* STRING */
        };
        
        // result: THINGNAME
        var thingname = Resources["EntityServices"].GetThingNameForIdentifier(params);
        //Things[thingname].temperature= temperature;
        
        var params1 = {
            oldestFirst: undefined /* BOOLEAN */,
            maxItems: undefined /* NUMBER */,
            endDate: undefined /* DATETIME */,
            query: undefined /* QUERY */,
            startDate: undefined /* DATETIME */
        };
        
        // result: INFOTABLE
        var result = Things[thingname].QueryPropertyHistory(params1);