4 Replies Latest reply on Jan 11, 2018 2:00 PM by aelgov RSS
    aelgov Apprentice

    Can't add row for infotable in runtime



    I want to create new infotable from datashape, then add rows to it.

    I get an error:


    JavaException: com.thingworx.common.exceptions.InvalidRequestException: Invalid Reference to Object In Script


    This is the code I use:



    var params = {

      infoTableName : "InfoTable",

      dataShapeName : "MyInfoTableDataShape"



    var myInfoTable = Resources["InfoTableFunctions"].CreateInfoTableFromDataShape(params);


    for(var i = 0; i < Logs.length; i++){


    var newEntry = new Object();

    newEntry.DateTime = logDateTime;

    newEntry.Reason  = log.Reason;




    var result = myInfoTable;


    When I add rows to an infotable property and add - var result = myInfotableProperty it works like a charm.