0 Replies Latest reply on Sep 1, 2017 8:33 AM by cschmerling RSS
    cschmerling Newbie

    how to store an InfoTable field in a DataTable using extension

    I am have a DataTable defined in my system, based on a data shape that has an InfoTable as one of the fields.  If I create a thing and populate the DataTable with data from the thing and a local thing service, it appears the data gets set for the InfoTable field.  While trying to populate the DataTable in an extension, all other fields seem to get fine, but the InfoTable does not seem to be getting set.


      InfoTable colorwaySizeInfoTable = dataTable.CreateValues();

       InfoTable contentInfoTable = InfoTableInstanceFactory.createInfoTableFromDataShape(colorwaySizeInfoTable.getField("ContentReferences").getDataShapeName());



       int refCount = ColorwaySizeInfo.rdmInt(1, 4);

       for(int i = 0; i < refCount; i++){

        ValueCollection v = new ValueCollection();

       v.SetStringValue("relativeURL", ColorwaySizeInfo.getFileRef());





        ValueCollection cwsize = new ValueCollection();

        cwsize.SetInfoTableValue("ContentReferences", contentInfoTable);

        String colorName = ColorwaySizeInfo.getColorName();

        cwsize.SetStringValue("ColorName", colorName);

        cwsize.SetStringValue("ColorRGB", ColorwaySizeInfo.getColorRGB(colorName));

        cwsize.SetStringValue("Size", ColorwaySizeInfo.getSize());

        cwsize.SetIntegerValue("ColorwayId", ColorwaySizeInfo.getColorwayId());



        dataTable.AddOrUpdateDataTableEntry(tags, location, source, null, colorwaySizeInfoTable);